|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Tab order for buttons on forms
Hi there,
I have a form with multiple submit buttons on it, each named "submit" but with different values, and each has a textbox next to it for typing in relevant search information. For example: 1st textbox and submit button are for searching by peoples names, 2nd for searching by id number etc.... The cursor starts in the first textbox, with the first button highlighted. This is fine but i was wondering if there was a way to make it so that if a user clicks in the second textbox and types, the second button automatically highlights so that the user can just push return instead of having to click the button. As it is, the first button is the only one which automatically highlights. I have tried putting each box and button on seperate forms which works to highlight the right boxes and buttons but makes it so that when i just push return, the code doesn't run. Still had to click on the button to get it to work so i put it all back on one form. As it stands the code works fine but with the above niggle. Any help will be greatly appreciated. Yaan out |
|
#2
|
|||
|
|||
|
Using some Javascript event handlers this should be easy. You need to use the onFocus event handler on the textbox when it becomes active. Then use this event to make the relevant submit button active.
The textbox: object.onFocus="myJavaScriptCode" The Submit Button: object.focus() You get the idea ![]() If your not sure do a search on google for the onfocus event handler and you should find some code snippets and plenty of info. |
|
#3
|
|||
|
|||
|
Cheers for the pointer, this sounds like what i'm looking for.
Thanks again Yaan |
|
#4
|
|||
|
|||
|
It looks like i'm going to have to live with it for now.
The only solution, short of trying to re-format the database or web-page, would be to install the "full text search" option that comes with ms sql200 server, and to make sure the web-host has it installed too. With that installed i could use the "CONTAINS" function or the "FREETEXT" function, both of which should solve the problem. If i have any more joy with it i'll let you all know. Yaan out |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Tab order for buttons on forms |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|