| <html> |
| <head> |
| <script type="text/javascript"> |
| function fun() |
| { |
| var name=document.form1.txtname.value; |
| var rollno=document.form1.txtno.value; |
| var add=document.form1.txtadd.value; |
| var mnf=document.form1.mf.value; |
| var two=document.form1.tw.value; |
| var four=document.form1.fw.value; |
| var photo=document.form1.ph.value; |
| if(rollno>70) |
| { |
| alert("Invalid rollno"); |
| } |
| else |
| { |
| Alert("Name: "+name+"\n"+"Rollno: "+rollno+"\n"+"Address: "+add+"\n"+"Gender: "+mnf +"\n"+"I have: "+two+"\n"+"I have: "+four+"\n"+"Path of photo: "+photo+"\n"); |
| } |
| } |
| </script> |
| </head> |
| <body> |
| <form name="form1"> |
| |
| <h1>REGISTRATION FORM</h1><br> |
| <p>Name : <input name="txtname" type="text"/></p> |
| <p>Roll No : <input name="txtno" type="text" /></p> |
| Address :<br> <textarea rows=4 cols=25 name="txtadd"></textarea> |
| <p>Gender : |
| <input name="mf" type="radio" value="Male" >Male |
| <input name="mf" type="radio" value="Female" >Female |
| </p> |
| I have a 2 wheeler : <input value="2 wheeler" type="checkbox" name="tw"/><br><br> |
| I have a 4 wheeler : <input value="4 wheeler" type="checkbox" name="fw"/><br><br> |
| Photograph : <input type="file" name="ph"> <br><br> |
| <input type="button" value="Submit" onclick="fun()"> |
| </form> |
| </body> |
| </html> |
No comments:
Post a Comment