Hi All,
I have written a confirmation page in
Struts which contains 1 label field "Username" and 2 buttons "Yes" & "No" respectively.
In IE when user navigates to the confirmation page I set the focus to the "Yes" button using following javascript code:
The above code works in IE
In Mozilla I tried to set focus on the button using the following code:
The above code does not work.
My observations:
For Mozilla browser:If I add any text field in the above confirmation page and set focus to it then whenever the user press enter key the "Yes" button is clicked. The code is as follows:
Javascript code:
Struts code (Addition of extra text field)
Problem:
I am not able to set focus on "Yes" button using javascript for Mozilla browser.I want that whenever user navigates to confirmation page and press enter key then "Yes" button should be selected.
Note: There is only a label field on my confirmation page and no text field
I have posted this question in this forum because I am using javascript to set focus on the buttons
Complete Code:
Please help me. I am struggling from last 2 days.
Thanks and regards.
[ April 18, 2008: Message edited by: Sahil Saxena ]