D
Dunc
I've got a Web page written in C#, and when it runs and the user presses
enter, it submits the first button on the form. As you'd expect. I want
the system to redirect to a different page when a user pressed enter from a
second textbox. I've used the line of code in the Page_Load:
SearchString.Attributes.Add("onKeyDown", "if (window.event) if
(window.event.keyCode == 13)
window.location='searchresults.asp?SearchString=' +
document.Form1.QuickSearch_SearchString.value;");
Problem is: it doesn't damn work. If I put an alert('test'); in the
beginning, it fires. However, it never actually gets past the conditions,
even though I've used (and tested!) this script on classic ASP pages; it
just submits the first button. I've tried changing it to onKeyPress, but
still no luck.
Has anyone successfully got this working, or can someone see something I'm
doing stupid here?
Thanks in advance,
Duncan
enter, it submits the first button on the form. As you'd expect. I want
the system to redirect to a different page when a user pressed enter from a
second textbox. I've used the line of code in the Page_Load:
SearchString.Attributes.Add("onKeyDown", "if (window.event) if
(window.event.keyCode == 13)
window.location='searchresults.asp?SearchString=' +
document.Form1.QuickSearch_SearchString.value;");
Problem is: it doesn't damn work. If I put an alert('test'); in the
beginning, it fires. However, it never actually gets past the conditions,
even though I've used (and tested!) this script on classic ASP pages; it
just submits the first button. I've tried changing it to onKeyPress, but
still no luck.
Has anyone successfully got this working, or can someone see something I'm
doing stupid here?
Thanks in advance,
Duncan