Skip to content

Instantly share code, notes, and snippets.

@abel-masila
Last active May 2, 2018 09:39
Show Gist options
  • Save abel-masila/b4b14c6c7ad705a37b3279815124950c to your computer and use it in GitHub Desktop.
Save abel-masila/b4b14c6c7ad705a37b3279815124950c to your computer and use it in GitHub Desktop.
const selectedGoods = quote.selected_goods;
if(this.goodsValidator.allValid()){
this.goodsValidator.hideMessages();
selectedGoods.push(selectedGood);
}else {
this.goodsValidator.showMessages();
// rerender to show messages for the first time
this.forceUpdate();
}
handleSubmit = (e) =>{
e.preventDefault();
if(this.qouteValidator.allValid()){
this.qouteValidator.hideMessages();
//handle submit here
console.log(this.state.quote);
LocalDB.insert("mci_form", this.state.quote);
this.props.history.push("/compare");
}else {
this.qouteValidator.showMessages();
this.forceUpdate();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment