Checkbox.onBlur : CheckBox : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » CheckBox »

 

Checkbox.onBlur









Syntax








onBlur="command"



The onBlur event handler is defined in an tag and specifies what to do when a check box loses focus.












<html>
    <form name="orderForm">
      <input type="checkbox"
             name="peppers"
             onBlur="pepperAlert()">Peppers<br>
      <input type="checkbox"
             name="sausage">Sausage<hr>
      Step 2:
      <input type="button"
             value="Order Pizza"
             name="orderButton"
             onClick="alert('Your pizza has been ordered.')">
    </form>
    <script language="JavaScript">
    <!--
    function pepperAlert()
    {
      if(document.orderForm.peppers.checked == true)
      {
        alert("peppers.");
      }
    }
    -->
    </script>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» CheckBox