Forum Moderators: phranque

Message Too Old, No Replies

Can I set the second input type="image" as default to enter key?

         

ktjrdn

8:26 pm on Jan 10, 2005 (gmt 0)

10+ Year Member



I have a form with many input type="text" boxes, and two separate input type="image" graphics. If the user presses enter after one of the text fields, the first image is selected by default. Is there a way to set the second one as defaut instead?

rocknbil

3:45 am on Jan 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



tabindex.

<input type="text" name="first_on_page" tabindex=20">
<input type="image" name="second_on_page_first_focused_on_tab" tabindex="1">

Keep in mind that the tab stops go through all objects in the window, from the address bar through the page, including form elements, links, and other objects. While you can generally "work" one area of a page or form, sometimes if you start messing with the tab indices you have to fiddle with them all.

ktjrdn

1:52 pm on Jan 11, 2005 (gmt 0)

10+ Year Member



Thanks for the info, but I my problem is a little different. I guess, I didn't explain well enough. My images are acting as submits. I'm not using the enter key as a tab - I'd like it to submit via the second image without the user having to tab through all the text boxes, as most of them are optional. I'd like to keep the tab stops where they are, though in case the user does fill them in.