Hi Folks,
I have been working on getting a small bug sorted on my site an I am having some troubles.
What I am trying to do is, if someone presses enter in a textbox I want it to perform an action, like open another page.
The function code is:
The code that is calling the function is:
When ever I press any key in the text box I get an error saying:
"Error: 'this.form.url' is null or not an object"
Please can some one tell me where I am going wrong??
I have been working on getting a small bug sorted on my site an I am having some troubles.
What I am trying to do is, if someone presses enter in a textbox I want it to perform an action, like open another page.
The function code is:
Code:
<script language="JavaScript"><!--
function handler(e) {
if (document.all) {
e = window.event;
}
var key;
if (document.layers)
key = e.which;
if (document.all)
key = e.keyCode
if(key=13)window.open( this.form.url.value);
}
//--></script>
The code that is calling the function is:
Code:
<input name="url" type="text" onKeyPress="handler()">
When ever I press any key in the text box I get an error saying:
"Error: 'this.form.url' is null or not an object"
Please can some one tell me where I am going wrong??