R
Robert Nurse
Hi All,
I'm trying to create a text field that, when two or more characters
are entered, the form is automatically submitted. The trouble I'm
having is knowing when the onSubmit handler is fired. It's supposed
to be executed when the form is submitted. I'm doing a submit via JS
which should cause the form to run the onSubmit handler. But, it
isn't. This leads me to believe that calling submit() is different
from a hard submit. True?
<SCRIPT language="Javascript1.2">
function submitLetters(form, control)
{
var returnValue = true;
if (event.keyCode == 13)
returnValue = false;
else
form.submit();
return returnValue;
}
function CheckFilter(form)
{
var returnValue = true;
alert("length: " + form.nTypeFilter.value.length);
if (form.nTypeFilter.value.length < 2)
returnValue = false;
return returnValue;
}
</SCRIPT>
<FORM name="ByLastName" method="post" onSubmit="return
CheckFilter(this);">
<INPUT type="text" name="nTypeFilter" value="" onKeyPress="return
submitLetters(ByLastName, this);">
</FORM>
I'm trying to create a text field that, when two or more characters
are entered, the form is automatically submitted. The trouble I'm
having is knowing when the onSubmit handler is fired. It's supposed
to be executed when the form is submitted. I'm doing a submit via JS
which should cause the form to run the onSubmit handler. But, it
isn't. This leads me to believe that calling submit() is different
from a hard submit. True?
<SCRIPT language="Javascript1.2">
function submitLetters(form, control)
{
var returnValue = true;
if (event.keyCode == 13)
returnValue = false;
else
form.submit();
return returnValue;
}
function CheckFilter(form)
{
var returnValue = true;
alert("length: " + form.nTypeFilter.value.length);
if (form.nTypeFilter.value.length < 2)
returnValue = false;
return returnValue;
}
</SCRIPT>
<FORM name="ByLastName" method="post" onSubmit="return
CheckFilter(this);">
<INPUT type="text" name="nTypeFilter" value="" onKeyPress="return
submitLetters(ByLastName, this);">
</FORM>