ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old July 18th, 2003, 06:08 AM
yaan yaan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 10 yaan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old July 18th, 2003, 08:30 AM
Spengos Spengos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 5 Spengos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old July 18th, 2003, 08:43 AM
yaan yaan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 10 yaan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

Cheers for the pointer, this sounds like what i'm looking for.

Thanks again

Yaan

Reply With Quote
  #4  
Old July 18th, 2003, 11:05 AM
yaan yaan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 10 yaan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Tab order for buttons on forms


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway