Writing information to forms. : Elements : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Elements »

 

Writing information to forms.

















<HTML>
    <HEAD>
    <TITLE>Example of Writing Form Elements</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function checkText(){
      ifdocument.FormExample3.textbox.value == "AAA"){
        alert("You are correct!");
      else {
        document.FormExample3.textbox.value = "AAA";
        alert("That is incorrect. The correct answer is now in the text box.");
      }
    }
    // End hide-->
    </SCRIPT>
    </HEAD>
    <BODY>
    <FORM NAME="FormExample3" METHOD=POST>
    Input <INPUT TYPE="text" NAME="textbox" SIZE=25>
          <INPUT TYPE="BUTTON" NAME="Bugs" VALUE="Submit" onClick="checkText(this.form)">
    </FORM>
    </BODY>
    </HTML>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Elements