Mega Code Archive

 
Categories / JavaScript DHTML / Form Control
 

Checkbox Action

<html> <body> <script type="text/javascript"> function convertField(field){     if (document.form1.convertUpper.checked){       field.value=field.value.toUpperCase()   } } function convertAllFields(){     document.form1.fname.value=document.form1.fname.value.toUpperCase()     document.form1.lname.value=document.form1.lname.value.toUpperCase() } </script> <form name="form1">     First name:      <input type="text" name="fname" onChange="convertField(this)" size="20" />     <br>     Last name:      <input type="text" name="lname" onChange="convertField(this)" size="20" />     <br>     Convert fields to upper case      <input type="checkBox" name="convertUpper"              onClick="if (this.checked) {convertAllFields()}" value="ON"> </form> </body> </html>