By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,728 Members | 2,414 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,728 IT Pros & Developers. It's quick & easy.

changing default button

P: n/a
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.

Chris
Sep 26 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
do you mean the tab index? are you able to explain / provide
non-working example?

Sep 26 '05 #2

P: n/a
<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>
</form>

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
default

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.