Thursday, 14 December 2017

Registration Form Using HTML and JAVASCRIPT

Registration form Using HTML and JavaScript(JS)


Program:

<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">
&nbsp;&nbsp;&nbsp;
<h1>REGISTRATION FORM</h1><br>
<p>Name : <input name="txtnametype="text"/></p>
<p>Roll No : <input name="txtnotype="text" /></p>
Address :<br> <textarea rows=4 cols=25 name="txtadd"></textarea>
<p>Gender :
<input name="mftype="radiovalue="Male" >Male
<input name="mftype="radiovalue="Female" >Female
</p>
I have a 2 wheeler : <input value="2 wheelertype="checkboxname="tw"/><br><br>
I have a 4 wheeler : <input value="4 wheelertype="checkboxname="fw"/><br><br>
Photograph : <input type="filename="ph"> <br><br>
<input type="buttonvalue="Submitonclick="fun()">
</form>
</body>
</html>


OUTPUT:


No comments:

Post a Comment