Hi All,
I've got a form which I'm trying to submit automatically when the user
has entered 2 or more characters in a text imput box. Here's my set
up:
<SCRIPT language="JavaS cript1.2">
function submitLetters(f orm, control)
{
var returnValue = true;
if (event.keyCode == 13)
returnValue = false;
else
{
if (CheckFilter(fo rm) == true)
form.submit();
else
returnValue = false;
}
return returnValue;
}
function CheckFilter(for m)
{
var returnValue = true;
if (form.nTypeFilt er.value.length < 2)
returnValue = false;
return returnValue;
}
</SCRIPT>
<FORM name="displayBy LastName" method="post" onSubmit="retur n
CheckFilter(thi s);">
<INPUT type="text" name="nTypeFilt er" value="" onKeyPress="ret urn
submitLetters(d isplayByLastNam e, this);">
</FORM>
I'm finding that nothing is getting into form.nTypeFilte r.value until
submitLetters() returns true. How can I manually force the key
pressed into the form field's value from my onKeyPress handler? Also,
how do I get the actual event key character rather than just its
numerical value?
I've got a form which I'm trying to submit automatically when the user
has entered 2 or more characters in a text imput box. Here's my set
up:
<SCRIPT language="JavaS cript1.2">
function submitLetters(f orm, control)
{
var returnValue = true;
if (event.keyCode == 13)
returnValue = false;
else
{
if (CheckFilter(fo rm) == true)
form.submit();
else
returnValue = false;
}
return returnValue;
}
function CheckFilter(for m)
{
var returnValue = true;
if (form.nTypeFilt er.value.length < 2)
returnValue = false;
return returnValue;
}
</SCRIPT>
<FORM name="displayBy LastName" method="post" onSubmit="retur n
CheckFilter(thi s);">
<INPUT type="text" name="nTypeFilt er" value="" onKeyPress="ret urn
submitLetters(d isplayByLastNam e, this);">
</FORM>
I'm finding that nothing is getting into form.nTypeFilte r.value until
submitLetters() returns true. How can I manually force the key
pressed into the form field's value from my onKeyPress handler? Also,
how do I get the actual event key character rather than just its
numerical value?
Comment