@Noel a bit late to party, but still: onsubmit is your friend here. See my stackoverflow answer to the similar problem: http://stackoverflow.com/a/27145461/1581069
Dňa nedeľa, 23. marca 2014 9:25:12 UTC+1 Noel da Costa napísal(-a): > > This makes sense but how would you actually prevent the form submission? > By what mechanism? > > > On Tuesday, May 29, 2012 8:17:09 AM UTC+2, Mark Mandel wrote: >> >> >> >> On Tue, May 29, 2012 at 4:14 PM, Igor Minar <[email protected]> wrote: >> >>> I find it hard to imagine that showing an error message next to the >>> incorrect field would be confusing, but maybe it is. >> >> >> Thanks for taking my word for it ;o) >> >> >>> >>> In that case you can just create a simple directive that will check the >>> state of the form (is it valid or not) and prevent form submission if >>> necessary. >>> >>> <form name="myForm" custom-prevent-submission="myForm.$error" >>> action="/myurl"> >>> .. >>> </form> >>> >>> >> Ah. Validation seems to be the answer. I will delve deeper into that >> section of the documentation. Thanks for your time. >> >> Mark >> -- >> E: [email protected] >> T: http://www.twitter.com/neurotic >> W: www.compoundtheory.com >> >> 2 Devs from Down Under Podcast >> http://www.2ddu.com/ >> >> -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
