Form - do nothing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thesti
    New Member
    • Nov 2007
    • 144

    Form - do nothing

    hi,

    i have a page with a form that i don't really need the data to be submitted.
    so, i don't supply a submit button for the form.

    all i need to do is to just validate the data entered by a user. something like "number validation" and etc.. i have a link with onclick javascript to do that.

    the problem is that when i press enter while focus is on one of the input control of the form. it seems that it submit the form and the page is refreshed, i don't want this because it reset all the field to empty and the error messages are dissapeared.

    how to solve this?

    thanks in advance
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    In your javascript, I believe you need to finish it with "return 0"

    Comment

    • thesti
      New Member
      • Nov 2007
      • 144

      #3
      hi,

      thx for the reply. i've done that, but the page is still refreshed or something.

      the value in the fields are gone.

      how to make a form, that do nothing (don't submit) when enter is pressed ?

      thanks

      Comment

      • thesti
        New Member
        • Nov 2007
        • 144

        #4
        i find out that this behaviour only happens in opera.

        so i think this is not a serious issue.
        thanks for helping

        Comment

        Working...