Forum Moderators: open

Message Too Old, No Replies

Changing which submit button has focus based on text field

Changing which submit button has focus based on text field

         

h2ojunkie

6:08 am on May 5, 2005 (gmt 0)

10+ Year Member



I have a very long form, and this form has multiple submit buttons.

Of course, the first submit button on the form automatically has focus to submit the forum via the Enter key.

What I would like to do is change which submit button has focus based on the text field the user lasted typed in.

So if I had the following items on a form:

text field 1
text field 2
submit button 1
text field 3
text field 4
submit button 2

When a user it typing in text field 1 or 2, submit button 1 would have focus so the user could hit the enter key to submit the form with button 1.

But if a user was typing in text field 3 or 4, submit button 2 would have focus so the user could hit the enter key to submit the form with button 2.

Can anyone point me in the right direction?

orion_rus

6:54 am on May 5, 2005 (gmt 0)

10+ Year Member



If somebody typing a text in <input type='text' /> field it focus stay on it. When do you want to send focus to required button?
Good luck to you

orion_rus

6:55 am on May 5, 2005 (gmt 0)

10+ Year Member



Why don't you make this in 2 forms?