stewartwebb
Programmer
Hi all,
I have a problem with my page I can't solve.
Basically I have a text box and 'onKeyUp' I perform a function which checks 'if(window.event.keyCode == 13)' if it does it performs the funtion below.
The problem is that when there is no value in the text box and I click return, 'fieldHasSpaces' (from the function above) does == 'Y'. Yet somehow the alert in this function does not display and the page submits. The annoying thing is I put an alert just before the 'document.form1.submit();' which was also not being displayed so i'm thinking the submit maybe caused by something else on the page. There is only 1 text box on the page.
Has anyone else come across this problem?
Thanks
Stewart
I have a problem with my page I can't solve.
Basically I have a text box and 'onKeyUp' I perform a function which checks 'if(window.event.keyCode == 13)' if it does it performs the funtion below.
Code:
function funcFind()
{
checkForSpaces(document.form1.FIND.value)
if(fieldHasSpaces == "Y")
{message.innerHTML = "";
message.innerHTML = "You must enter a search value";
alert("You must enter a search value");
funcSetFocus();
return;
}
document.form1.entpoint.value = "Find";
document.form1.submit();
}
The problem is that when there is no value in the text box and I click return, 'fieldHasSpaces' (from the function above) does == 'Y'. Yet somehow the alert in this function does not display and the page submits. The annoying thing is I put an alert just before the 'document.form1.submit();' which was also not being displayed so i'm thinking the submit maybe caused by something else on the page. There is only 1 text box on the page.
Has anyone else come across this problem?
Thanks
Stewart