How to get Focus on one Button,if two buttons exists on the same form
-
Hi, I am Ravindra,presently doing a project in asp.net. The Login page of my Web Project consists of two Buttons. If user enters his username and password and clicks on enter button of keyboard, the Signin button is to be submitted not the other button. So,please specify how to get focus on the specified Button Thanks in advance. Ravindra
-
Hi, I am Ravindra,presently doing a project in asp.net. The Login page of my Web Project consists of two Buttons. If user enters his username and password and clicks on enter button of keyboard, the Signin button is to be submitted not the other button. So,please specify how to get focus on the specified Button Thanks in advance. Ravindra
Javascript can be used.
With Regards Satips
-
Hi, I am Ravindra,presently doing a project in asp.net. The Login page of my Web Project consists of two Buttons. If user enters his username and password and clicks on enter button of keyboard, the Signin button is to be submitted not the other button. So,please specify how to get focus on the specified Button Thanks in advance. Ravindra
put the script below in your page. function ButtonPress (evt, btnID) { if (evt.keyCode == "13") {evt.returnValue= false ; evt.cancel= true ; document.getElementById(btnID).click(); return false; } } //the code behind should have this.txtPassword.Attributes.Add("onKeyPress", @"ButtonPress(event, '" + @this.ButtonSignin.ClientID + @"')"); //this code will cause the button click event when the user presses enter and the textbox has the focus. Basically you can set a default button for each textbox
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06
-
Hi, I am Ravindra,presently doing a project in asp.net. The Login page of my Web Project consists of two Buttons. If user enters his username and password and clicks on enter button of keyboard, the Signin button is to be submitted not the other button. So,please specify how to get focus on the specified Button Thanks in advance. Ravindra