Nullified Posted September 3, 2012 Share Posted September 3, 2012 To make this as short as possible: I have a jquery .click function that is assigned to the form's submit button. The function disables the default event, performs a validation and is then suppose to submit the form. This works properly, however the developers of WHMCS decided to put an input field in the form that is named submit (I have no idea why they would name it a reserved javascript function) , therefor I had to remove it and am trying to add it back upon form .submit. For someone reason though when I call submit as seen in the .click function below the .submit function never gets called: jQuery(document).ready(function() { $('#validateUser').click(function(event) { event.preventDefault(); var frm = this.form; if (frm.name == "orderfrm") {showID("processingCircle"); jQuery("#validateUser").attr("disabled", "disabled");} jQuery.post("includes/vbulletin.php", {task: "check", username: jQuery("#customfield1").val()}, function(result) { if (result == "available") { frm.submit(); } else { alert("Some strange error occurred. You probably tried using some crazy messageboard username..."); } }); }); $("#orderfrm").submit(function() { jQuery('<input>').attr({type: "hidden", name: "submit", value: "true"}).appendTo("#orderfrm"); }); }); 0 Quote Link to comment Share on other sites More sharing options...
stormy Posted September 13, 2012 Share Posted September 13, 2012 I asked support about this, here's Andrew's reply: Please try renaming the field to checkout from submit and this should still work as normal. Have you found that something breaks if you remove the input? 0 Quote Link to comment Share on other sites More sharing options...
Nullified Posted September 13, 2012 Author Share Posted September 13, 2012 I found a work around, by adding another button called validate and showing the submit button after the validation. I tried removing the input and the checkout will never submit, but I haven't tried renaming it. thanks for asking them for me. 0 Quote Link to comment Share on other sites More sharing options...
stormy Posted September 13, 2012 Share Posted September 13, 2012 Well, it was bugging me too - I'm also using jquery validate. However, my form was submitting ok, even if the error appeared briefly in the Console. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.