T
Tom de Neef
I have a form with a text field and a button and a simple script:
<script type=text/javascript>
function action()
{
document.getElementById("result").innerHTML =
someProcess(document.form.input.value)
}
</script>
<form name="form">
<input type="text" name="input" value="">
<input type=button value="Go" onclick=action()>
</form>
<p id="result"> </p>
It does what it should do: display the results of some process, acting on
the value of the text field, when the button is clicked.
My question: is it possible to and add an event handler that is triggered
when the user completes his input with an Enter key hit (and maybe scrap the
button) ? Like onenterkeydetected=action().
Thanks,
Tom
<script type=text/javascript>
function action()
{
document.getElementById("result").innerHTML =
someProcess(document.form.input.value)
}
</script>
<form name="form">
<input type="text" name="input" value="">
<input type=button value="Go" onclick=action()>
</form>
<p id="result"> </p>
It does what it should do: display the results of some process, acting on
the value of the text field, when the button is clicked.
My question: is it possible to and add an event handler that is triggered
when the user completes his input with an Enter key hit (and maybe scrap the
button) ? Like onenterkeydetected=action().
Thanks,
Tom