D
David Lozzi
Howdy,
I'm using asp.net 2.0 and am trying to get one text box on the page, after
the user presses enter, to "click" a specific button. I copied the
javascript I used for a .net 1.1 web app I did a while ago but it doesn't
appear to work with .net 2.0? Below is my script. Any ideas?
<script language="javascript">
function clickButton(e, buttonid){
var bt = document.getElementById(buttonid);
if (typeof bt == 'object'){
if(navigator.appName.indexOf("Netscape")>(-1)){
if (e.keyCode == 13){
bt.click();
return false;
}
}
if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){
if (event.keyCode == 13){
bt.click();
return false;
}
}
}
}
</script>
in the textbox
onkeydown="javascript: return
clickButton(event,'_ctl0_uscTopBag_btnSearch');"
The event fires to the line of bt.click() but it doesn't appear to click it.
The ID for the button I am sending is what the ID of the button is after the
page renders, which javascript likes. Any ideas?
Thanks!!
David Lozzi
I'm using asp.net 2.0 and am trying to get one text box on the page, after
the user presses enter, to "click" a specific button. I copied the
javascript I used for a .net 1.1 web app I did a while ago but it doesn't
appear to work with .net 2.0? Below is my script. Any ideas?
<script language="javascript">
function clickButton(e, buttonid){
var bt = document.getElementById(buttonid);
if (typeof bt == 'object'){
if(navigator.appName.indexOf("Netscape")>(-1)){
if (e.keyCode == 13){
bt.click();
return false;
}
}
if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){
if (event.keyCode == 13){
bt.click();
return false;
}
}
}
}
</script>
in the textbox
onkeydown="javascript: return
clickButton(event,'_ctl0_uscTopBag_btnSearch');"
The event fires to the line of bt.click() but it doesn't appear to click it.
The ID for the button I am sending is what the ID of the button is after the
page renders, which javascript likes. Any ideas?
Thanks!!
David Lozzi