Jump to content

is the jquery.js functions denying me the ability to stop form submit?


Nullified

Recommended Posts

I am trying to either stop or permit the checkout form to submit itself based on the results of a confirm.

 

function showNotes(txt,btnValue) {
txt = txt || "Would you like to enter any notes / additional information for the staff?";
if (confirm(txt)) {
	jQuery("#notesField").slideDown();
	return false;
} else {
	jQuery("#submitFRMBTN").attr('value') = btnValue;
	return true;
}
}

<input type="submit" value="{$LANG.completeorder}"{if $cartitems==0} disabled{/if}{if $shownotesfield} onclick=" showNotes('{$LANG.orderenteradditionalnotes}','{$LANG.pleasewait}');"{/if} class="buttoncomplete" id="submitFRMBTN" />

I have tried numerous variations using return false, event.preventDefault(), event.stopPropagation() and tried using javascript instead of jQuery functions. However, no matter the code the form always submits.

Link to comment
Share on other sites

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