Checkbox Action : CheckBox : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » CheckBox »

 

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>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» CheckBox