40 users online (0 members and 40 guests)  


  Results 1 to 6 of 6

Related

  1. Replies: 1
  2. Controlling QuickTime with JS    Forum: Javascript Forum
    Replies: 0
  3. ASP Forms - Enter Key    Forum: ASP Forum
    Replies: 1
  4. Submitting form without pressing "Enter"    Forum: HTML Forum
    Replies: 1
  5. Enter password    Forum: HTML Forum
    Replies: 3
  1. #1
    dingusworrel
    dingusworrel's Avatar
    Guest

    Controlling Enter key in a form

    I have a form which is used for data entry. The users are complaining that they are used to the old mainframe mentality of hitting an enter key instead of tab. Alright, mainframes went out with the hula hoop. But I still need to figure out a way to stop this nonsense now.

    I'm calling a PHP script, but need to catch the offending "Enter" key before the form is left because these users are performing a phone survey and don't want to loose their place.

    Any ideas are greatly appreciated.

    Dingusworrel

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662

    ah ha

    Welcome to the forums!

    No matter how much people put down JavaScript, it does have its uses.

    onsubmit, just call a function that checks whether all fields have content. If not, it bails the form submission.

    Post if that doesn't help/need more.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    i don't mean to put down javascript either, but that can be done with php too(I know u know dean ) without refreshing the page, I have a script but javascript will work just fine. Either way. I can provide you with the php if u want?

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    I know what you mean.

    In this case, I thought that instant feedback would be preferable, as they are filling in a quiz.

    You know how much I love php in this example, tho, I felt JS would be simpler and more practical.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    though the php way is a little bit more coding, the affect is a tad bit better. But JS would be much easier to code so I agree with you but I always hate mixing php and JS... they just don't seam to like each other too much, espeiclaly if ur using them both on the same from

  6. #6
    Zaire's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2001
    Location
    Hamburg, NY
    Posts
    312
    Originally posted by Derek
    though the php way is a little bit more coding, the affect is a tad bit better. But JS would be much easier to code so I agree with you but I always hate mixing php and JS... they just don't seam to like each other too much, espeiclaly if ur using them both on the same from

    Your kidding right? PHP and JS are an awsome combo in alot more situations than you can think of

    Eric



Tags for this Thread