↧
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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleSubmitting 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
More Pages to Explore .....