Jump to content

jQuery .Submit()


Nullified

Recommended Posts

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");
});
});

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated