Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Mar 2010
    Location
    Orlando, FL
    Posts
    159
    Thanks
    4
    Thanked 8 Times in 8 Posts

    Assigning submit button to the enter key

    I have two submit buttons on one form on my site. Is there a way to assign which fields on the form, when enter is pressed, activates a certain submit button and not the other?

  • #2
    Regular Coder
    Join Date
    Mar 2010
    Location
    Orlando, FL
    Posts
    159
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Is this even possible?

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    could be possible, I suppose with some JS. Of course, if you move the cursor using the tab key, to give focus to the correct submit button, the enter key will 'use' it because it has been highlighted.


    Is this for a public website? If so, why do something different from the standard way of user interfacing, which can only confuse visitors?

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #4
    New Coder
    Join Date
    Dec 2008
    Location
    india
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can try to do it by using Javascript, when clicking one submit button pass the value of the selected form fields when clicking submit button, for this write a function using javascript and call the function onSubmit()..


  •  

    Posting Permissions

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