Javascript-form
User must be able to insert name,address,gender,stream and module....when user clicks the clear button,the form should be cleared, and when user clicks the Ok Button,the name and a
Solution 1:
Try this, It will display two fields in display area,In order to use reset function use type=reset in form input it will reset form fields
<inputtype="reset" value="Reset form" />
Script
functionclickOk(){
  if(document.getElementById("txtName").value!=" "){
              if(document.getElementById("txtAdd").value!=" "){
                   var nam=document.getElementById("txtName").value;
                   var add=document.getElementById("txtAdd").value;
              document.getElementById("display").innerHTML='<hr>Hi ' 
             +nam+'<br>Address: '+add;
                        }
              elsealert("Please enter your Address");
              }
elsealert("Please enter your Name");
}
Post a Comment for "Javascript-form"