Welcome Guest, Not a member yet? Register   Sign In
how to check email exist with Jquery and ajax?
#5

[eluser]Silviu[/eluser]
*** Note ***: You cannot really prevent a user submitting a form. All it has to do is to disable JS in the browser.

To stop a form from being submitted, you must "return false" on the form's onsubmit event.

Code:
<form on+submit="checkFields()">
......
</form>

<scri+pt>
   function checkFields(){
       if(!conditions_are_met)
           return false;
   }
</scri+pt>
(replace 'on+submit' with 'onsubmit' and 'scri+pt' with 'script' in your code)

As noted before, this is not a safe way to accept user input.
To be sure, you must re-check the data in the method that receives and processes the input.


Messages In This Thread
how to check email exist with Jquery and ajax? - by El Forum - 05-19-2012, 03:23 AM
how to check email exist with Jquery and ajax? - by El Forum - 05-19-2012, 07:12 AM
how to check email exist with Jquery and ajax? - by El Forum - 05-19-2012, 11:35 AM
how to check email exist with Jquery and ajax? - by El Forum - 05-19-2012, 12:18 PM
how to check email exist with Jquery and ajax? - by El Forum - 05-22-2012, 06:04 AM
how to check email exist with Jquery and ajax? - by El Forum - 05-23-2012, 04:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB