Monday 15 February 2010

html - How to Prevent form submitting using jquery? -


In fact, in the jsp page I am using spring tags and jquery code. Hear my code ..

  & lt; Form: Form Action = "Process" & gt; & Lt; P class = "forget" & gt; & Lt; A href = "Login / Forgot Password" class = "submit_forgot password" & gt; Forgot your password? & Lt; / A & gt; & Lt; / P & gt; & Lt; P class = "remember" & gt; & Lt; Input id = "signin_submit" value = "sign in" tabindex = "6" type = "submit" & gt; & Lt; / P & gt; & Lt; / Form: Form & gt; & Lt; Script & gt; $ ('# Login'). Submit to: function () {$ .blockUI ({Message: '': {Target: '#', success: function (feedback text, status text, excerpt, $ form) {warning (response text);} & Lt; h1 & gt; Just a moment ... & lt; / h1 & gt; '});}}} $ ('. Submit_forgotPassword ') (function (event) {event.preventDefault (); // Default Hyperlink Behavior $ ("# Login") Ent ("Action", $ (this) .attr ("href")); $ ("# login"). Submit ();}); & lt; / Scripts & gt;   

The problem form is not necessarily the necessary car Rawai

Actually two actions in my code 1. submit 2. forgot password ?

1. For the first time We give the right price and click submit. It is working perfectly ..

2. Second time (after click logout) we send emails and forgot password ? Link email will send an email ID that is also working perfectly ... Now the problem has occurred ...

3.3 times when we give correct value Are and Click submit to send email to email (this is working as a second step) ...

Why is it working so I am specifying every click operator form ...

Ever forgot password?

You forgot the password by clicking the "Forgot Password" button Forms are changing on the "gone" link. We have to link the "submit" to submit the form or else the "Submit" button will post on the "forgot password" link.

  & lt; Script & gt; $ ('# Login'). Submit to: function () {$ .blockUI ({Message: '': {Target: '#', success: function (feedback text, status text, excerpt, $ form) {warning (response text);} & Lt; h1 & gt; Just a moment ... & lt; / h1 & gt; '});}}} $ ('. Submit_forgotPassword '). (Function (event) {event.preventDefault () ; // Prevent the default hyperlink behavior Save the original form before saving it before submitting the link link var submitBtnLink = $ ("# LOGIN" $. ("Action"); $ (" $ ("Action", $ (this) .attr ("href")); $ ("# login"). Submit (); // Forgot Password $ ("# Login") and submit Return to the form action to submit the link. At ("Action", submitBtnLink);}); & lt; / script & gt;   

Try it < / Div>

No comments:

Post a Comment