|
<TEXTAREA ...>onChange = "script command(s)"| Usage Recommendation |
|---|
| use it, but don't rely on it |
onChangeonKeyPress
onChange<HEAD>
<SCRIPT TYPE="text/javascript">
<!--
function setupper(myfield)
{
if (myfield.inchange)return;
myfield.inchange=true;
myfield.value=myfield.value.toUpperCase();
myfield.inchange=false;
}
//-->
</SCRIPT>
This script accepts a field object as input, the resets the value of the field to upper case. We can then call the script in the
onChange
<TEXTAREA ROWS=10 COLS=20 NAME="IDlist" onChange="setupper(this)" ></TEXTAREA>
Notice that the one argument for the script is this, meaning that the field passes itself as the argument. This gives us the following form. Type something into the text area, then click in the next field.
Copyright 1997-2002 Idocs Inc. Content in this guide is offered freely to the public under the terms of the Open Content License and the Open Publication License. Contents may be redistributed or republished freely under these terms so long as credit to the original creator and contributors is maintained.