i want the code to run a procudere when enter key is pressed in asp.net apllication (help plz)
-
i want the code to run a procudere when enter key is pressed in asp.net apllication .the key event should happen when i press the enter key in textbox.
Use Javascript function and call it on the server side. TextBox1.Attributes.Add("onkeypress","CheckKeyCode();") Validate the key as: function CheckKeyCode() { if(event.keyCode == 13) { return true; } else { return false; } } God is always with you.
-
i want the code to run a procudere when enter key is pressed in asp.net apllication .the key event should happen when i press the enter key in textbox.
jagadeeshkumar2106 wrote:
i want the code to run a procudere
this procedure is written in Javascript? if yes, chk the example below.. Example.
function fireFunc() { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { **yourprocedure();** } } <input type="text" value="Check Answer" onkeypress="fireFunc()" >
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
jagadeeshkumar2106 wrote:
i want the code to run a procudere
this procedure is written in Javascript? if yes, chk the example below.. Example.
function fireFunc() { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { **yourprocedure();** } } <input type="text" value="Check Answer" onkeypress="fireFunc()" >
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
sorry. i didn't see Saranya Devi's post.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
jagadeeshkumar2106 wrote:
i want the code to run a procudere
this procedure is written in Javascript? if yes, chk the example below.. Example.
function fireFunc() { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { **yourprocedure();** } } <input type="text" value="Check Answer" onkeypress="fireFunc()" >
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
Call your procedure like this: function getProcedure() { var obj obj=document.getElementById("button2") button2.click(); } "severside_handler" is the codebehind function that hander the button's server click event. God is always with you.
-
i posted the answer in your new post..
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
Call your procedure like this: function getProcedure() { var obj obj=document.getElementById("button2") button2.click(); } "severside_handler" is the codebehind function that hander the button's server click event. God is always with you.
-
var obj obj=document.getElementById("btngetdata"); obj.click(); i wrote like this and i kept two alerts before and after .but iam getting the two messages in the alert but iam not getting the this obj.click.
Try btngetdata.click(); God is always with you.