Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Mar 2002
    Location
    Tampa, Florida, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    form with no action

    How do I construct a form with an text input field for which no action occurs when the user enters data?

    I want to use JavaScript event handlers to control what occurs. But with Netscape, when I enter text in the field and press the Enter key (which the user is likely to do), the event handler fires, but then the page reloads itself. I don't want the page to reload. IE seems to do what I want, but not Netscape (version 4).

    <form ...I donno what here...>
    Enter data: <input name=test onChange="dothis()">
    </form>

    (I do not want a submit element; I do not want the user to see or have to click a button.)

    I have tried many combinations of post, action and onSubmit parameters to the form statement, but I cannot keep the page from reloading.

    Any ideas?

    Thanks,

    - hmc

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: form with no action

    Theoretically, this should work:

    <FORM [your code] onSubmit="return false">

    Is that the code that works in IE and not NS?

Posting Permissions

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