Forum Moderators: open
I have a form that has a textfield called QTY,
Can someone please tell me how i can auto submit the form when the value of this text field is changed.
Thanx in advanced.
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
var foo;
function submitTheForm(which) {
which.form.submit();
}
</script>
</head>
<body>
<form>
Qty:
<input name="qty" type="text" onchange="submitTheForm(this)" onkeyup="foo = setTimeout('submitTheForm(this)',1000)" onkeydown="if(foo){clearTimeout(foo)}">
</form></body>
</html>
The form will submit immediately on blur (change)... It will also submit within 1 second of the last key press. So, if you type "10" and don't pause more than 999 milliseconds between the key presses it will not submit until you're done typing.