470,581 Members | 2,427 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,581 developers. It's quick & easy.

changing default button

i have a form with 3 buttons with a text box next to each button

what i want to do is when a textbox is filled out the default button is
changed to the button next to that text box rather than the first button on
the form.

how would i do this.

Sep 26 '05 #1
2 2593
do you mean the tab index? are you able to explain / provide
non-working example?

Sep 26 '05 #2
<form method="POST" action="page.html">
<p><input type="text" name="box1" size="20"><input type="submit"
value="Button 1" name="B1" onclick (do something 1)></p>
<p><input type="text" name="box2" size="20"><input type="submit"
value="button 2" name="B2" onclick (do something 2)></p>
<p><input type="text" name="box3" size="20"><input type="button"
value="button 3" name="B3" onclick (do something 3)></p>

in the above example if box 3 is filled in and you press the enter key,
button 1 will be operated as it is the first button on the page and is the

what I want is when box 3 is filled out and the enter key is pressed button3
is operated, maybe when one of the text boxes gets the focus then the
appropriate button is set as default - hope you understand what I want
<ij********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
do you mean the tab index? are you able to explain / provide
non-working example?

Sep 26 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Free-Ed, Ltd. | last post: by
4 posts views Thread by Robson Carvalho Machado | last post: by
2 posts views Thread by Colin McGuire | last post: by
3 posts views Thread by Don Miller | last post: by
1 post views Thread by livre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.