• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javascript - onfocus() problem

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

I am using a jsp which have multiple input text boxes, a Search button (submit action) and a Advance Search (another submit button).
Now whenever user clicks on any of input box a javascript onfocus is called to Focus the Search button. But the first of submit button i.ee in my case Advance search button always gets focus. As it comes first on UI.
Is there any way to specifically mention which button to foucs ?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure what you are talking about here. Are you focusing the button or are you talking about the browser's default behavior?

Eric
 
Dinesh Bang
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To elobrate,

I have input search text field. And two buttons label "Advance Search" and "Search". Both the are of type "submit"
Now in the jsp (JSF) file , the "Advance Search" button comes first and then the "Search" button.
When the user clicks input text are, the first button of "submit" type gets focus. Is there a way to specify which button should get focus by default?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The form will select whatever comes next. You can look into tab index, but I doubt it will make a difference with default submit action.

Eric
reply
    Bookmark Topic Watch Topic
  • New Topic