jquery - In an ASP.NET MVC 3 view, how to handle all form submission in JavaScript? -


In this asp.net MVC 3 view, I submit the form completely via javascript (i using jquery) need to. Specifically, logic presented through my form of contact through the server, which is a comet structure (an improvement on Ajax, basically).

How can I set up Javascript handlers to present any type of view (eg, by clicking submit button or entering in a field)? Handler needs to completely disable form submissions while processing the server.

Keep in mind that I am also making controversial client side validation as a visual.

You can use it or manually by adding a global script to all pages: < / P>

  $ (function () {$ ('form'). Submit (function () {if ($ (this). Valid ()) {// Client verification pass => Send it with AJAX $ .ajax ({url: this.action, type: this.method, data: $ (this). Serialize ()})} return false;});});    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -