SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast wildekyote's Avatar
    Join Date
    Apr 2003
    Location
    Fredericksburg, VA
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Prevent Enter Button from Submitting

    I have a form where I need to prevent enter from submitting. I produce an error when a user presses enter once completing a text field rather than clicking the submit button. There are circumstances as to why this has to work this way. I've searched old posts and have found them to suggest validation. I've validation in there at this point, but do to the process progression needed the Enter button just works about as well as a monkey wrench in gears.

    I've tried onsubmit='return false' with no luck I've tried setting the onClick function I'm using on the button in an onSubmit event and that didn't work. I know it's possible to block it I just can't figure it out. Can anyone out there throw me a bone?
    You only regret the risks you didn't take.

    Keith Andersen.com

  2. #2
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    use textarea instead of input
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  3. #3
    SitePoint Enthusiast powdermonster's Avatar
    Join Date
    Apr 2002
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this is what you are after

    http://javascript.internet.com/forms...y-disable.html
    Keri

    jamesbond-007.info
    cPanel Guide


Bookmarks

Posting Permissions

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