prevent submission

Results 1 to 2 of 2

Thread: prevent submission

  1. #1
    Join Date
    Dec 1969

    Default prevent submission

    hi<BR><BR>I want to prevent the form from getting submitted when i hit enter in a text box in my form.I&#039m using the IE .<BR>the code is if(window.keycode.event==13) {<BR> function();<BR>}<BR>now this function is getting fired but also the page is getting submitted which i dont want to happen as the page has to submit only if the submit button is clicked.<BR>could someone pl. tell me if there&#039s anyway to prevent this from happening. Thanks<BR><BR>Al

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: prevent submission

    remove the action from the form tag. Call the function only in the onclick event of the button (NOT submit button just button) and then set the action and submit the form

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts