Solution:
I have a form which has a search text box. The user enters the search keywords and presses enter.
Below is the code (HTML rendering in this blog is awful, sorry about the illegible code) which does that
<script language="javascript" type="text/javascript">
function submitOnEnter(event)
{
var keycode;
if (window.event)
keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode ==13)
{
location.href ="default.aspx";
location.reload;
// this always get me!! I forget to call the reload}
}
</script>
Search
onclick="default.aspx">
A much more simpler implementation can be done using JQuery.
Thanks to jackson pushpanathan for this piece of work.You can find the original code here
http://technosia.blogspot.com/2008/10/navigate-to-another-url-by-pressing.html
No comments:
Post a Comment