Quantcast
Channel: Submitting a form with an onSubmit - Stack Overflow
Browsing latest articles
Browse All 7 View Live

Answer by Rick Suggs for Submitting a form with an onSubmit

Don't use the onsubmit attribute, it's mixing JavaScript into html markup, and goes against best practices.Why don't you make the validation part of the register function (server side). That way you...

View Article


Answer by jk. for Submitting a form with an onSubmit

Remove onsubmit="validate(this); return false;"And use the following function:$('form').submit(function(e){ e.preventDefault(); var $form = $(this), $formId = $form.attr('id'), $formName =...

View Article

Answer by Michael MacDonald for Submitting a form with an onSubmit

In your block } else { $('#'+ obj.id).submit(); }Rather than do an actual form submission use another ajax call to send your data to your forms action endpoint:} else { $.ajax({ url : obj.action ,type...

View Article

Answer by GVdP for Submitting a form with an onSubmit

This should work: Unbind the event before re-submitting.Instead offunction validate(obj) { $.ajax({ url : "ajax/validate_check.php", type : "POST", data : $("#"+ obj.id).serialize(), success :...

View Article

Answer by balexandre for Submitting a form with an onSubmit

Don't submit it again using the submit call, as you say, you will be in a loop... just post everything like a submit:change your $('#'+ obj.id).submit(); line by submitForm() and addfunction...

View Article


Answer by Cristian for Submitting a form with an onSubmit

i'd not issue another submit in your else branch, but return a true value.in your onsubmit i'd do onsubmit="return validate(this);"

View Article

Submitting a form with an onSubmit

My form onSubmit is calling: onsubmit="validate(this); return false;"validate(); is as follows:function validate(obj) { $.ajax({ url : "ajax/validate_check.php", type : "POST", data : $("#"+...

View Article
Browsing latest articles
Browse All 7 View Live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>