The code is as follows
<form
name="orderForm"
method="post"
action="{{action}}"
ng-submit="onSubmit($event)"
>
...
</form>
To prevent the form submit i have used
scope.onSubmit = function(e) {
e.preventDefault();
if(valid condition) {
// submit form programmatically
// scope.orderForm.ngSubmit.emit(); doesn't seem to work
}
};
Now i need to submit the form programmatically when a specific condition is satisfied. i have used scope.orderForm.ngSubmit.emit() but doesnt seem to work.
Any idea on how to fix this?