Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

including img in tab order

Status
Not open for further replies.

wrbodine

Programmer
Aug 24, 2000
302
US
I'm wanting an img that's on a .asp page to be able to be tabbed to as the user tabs from one text box to the next. Right now it skips over this image and doesn't go to it.

Any ideas for how this can be done?

Thanks,
Ray
 
<input type=image src=&quot;path/file.gif&quot;>

Something like that so that it's actually a member of the form, and therefore will get tabbed.

:)
Paul Prewett
penny.gif
penny.gif
 
Just a comment to any others who might try this code: For some reason, when I'm using the input tag like in the example above, a click on the image causes a record to be submitted twice into the database instead of once (as though the button were clicked twice). This is wierd, because when the button is clicked it calls code that not only enters a record in a database, but also calls response.redirect to go to another page. So I'm surprised its even able to enter a record twice before going to that page. If anyone knows why this might be I'd love to know.

Thanks,
Ray
 
Maybe write a custom function for the onClick and/or onEnter event for that particular element like:

function imageClicked(){
document.formName.submit();
return false;
}

<input type=image src=&quot;pic.gif&quot; onClick=&quot;imageClicked();&quot; onEnter=&quot;imageClicked()&quot;>

Something like that with the return false just to be on the safe side and know that only the one action is being performed?

Now obviously, that line shouldn't really be encountered at all, but if for some reason it is, the function just dies.
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top