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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    designating a button through 'ENTER'

    I have 2 submit buttons. Without rearranging the order of the buttons, how can i make the enter (return) button submit the submit button i want?
    If I'm postin here, I NEED YOUR HELP!!

  • #2
    Regular Coder
    Join Date
    Jul 2004
    Location
    mile high city
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you post some code?
    Computer, kill Flanders... Did I hear my name? My ears are burning...
    Good start. Now finish the job.

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts
    PHP Code:
    <form action='page' method='post'>
    <
    input type='text' name='variable'>
    <
    input type='submit' value='Enter 1' onClick='action()'>
    <
    input type='submit' value='Enter 2'>
    </
    form
    Obviously just an example. But I would want button 'Enter 2' to be submitted when they hit return on their keyboards, not 'Enter 1'. How?

    (I cant rearrange them)
    If I'm postin here, I NEED YOUR HELP!!

  • #4
    Regular Coder
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    435
    Thanks
    1
    Thanked 0 Times in 0 Posts
    something like <form onLoad="document.form.button2.focus()">

    btw, name your buttons!

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts
    In my actual script they are named.

    Will the point of giving it focus be lost once they click inside another field?
    If I'm postin here, I NEED YOUR HELP!!


  •  

    Posting Permissions

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