Focusing a HTML button in Javascript..
-
Dear Friends.. I am having an .aspx page in which i have various HTML controls such as text boxes and buttons("OK" and "CLEAR" buttons).By default, when i press the "ENTER" key in my keyboard ,the "OK" button must get fired...But its not getting fired..I need to use the tab button to make that "OK" button get fired..How to make the "OK" button get fired without using the TAB key..? " I use javacript for validation..Is there anything do with javascript in this regard..? Regards,
Balaguru
-
Dear Friends.. I am having an .aspx page in which i have various HTML controls such as text boxes and buttons("OK" and "CLEAR" buttons).By default, when i press the "ENTER" key in my keyboard ,the "OK" button must get fired...But its not getting fired..I need to use the tab button to make that "OK" button get fired..How to make the "OK" button get fired without using the TAB key..? " I use javacript for validation..Is there anything do with javascript in this regard..? Regards,
Balaguru
Sorry Friends... A small correction in the above post..I need to fire a image.i.e i am having an image button instead of HTML Button.. Regards,
Balaguru
-
Sorry Friends... A small correction in the above post..I need to fire a image.i.e i am having an image button instead of HTML Button.. Regards,
Balaguru
Hello.. i am not very sure how asp.net renders the image button into the html. But anyhow u can try this..
//on preRender myImageButton.attributes.add("type", "submit");
On pressing enter key, the Form.Submit event is fired. By assosiaciting the above attribute with ur image buttong it will work if the Image Button is renndered as , but otherwise too u can use the same understanding to get the job done. Keep me updated with the same.. Regards. -
Dear Friends.. I am having an .aspx page in which i have various HTML controls such as text boxes and buttons("OK" and "CLEAR" buttons).By default, when i press the "ENTER" key in my keyboard ,the "OK" button must get fired...But its not getting fired..I need to use the tab button to make that "OK" button get fired..How to make the "OK" button get fired without using the TAB key..? " I use javacript for validation..Is there anything do with javascript in this regard..? Regards,
Balaguru
Normally when you press enter, the first button in the form is activated. There are some form elements that catch the enter key, though, like textarea and select. If you want the enter key to work when these controls have focus, you have to use Javascript to catch the key and post the form instead.
--- single minded; short sighted; long gone;
-
Hello.. i am not very sure how asp.net renders the image button into the html. But anyhow u can try this..
//on preRender myImageButton.attributes.add("type", "submit");
On pressing enter key, the Form.Submit event is fired. By assosiaciting the above attribute with ur image buttong it will work if the Image Button is renndered as , but otherwise too u can use the same understanding to get the job done. Keep me updated with the same.. Regards.Hi Mani.. Ok..Fine..But i need to write in HTML content...How to do it in javascript..? Regards,
Balaguru