0
4.9kviews
Write JavaScript program to validate a form which accepts name, age, Email, and phone number of a student

Mumbai University > Information Technology > Sem 4 > Web Programming

Marks: 10M

Year: Dec 2014, Dec 2015

1 Answer
0
298views
<html>
<head>
<title> FormData</title>
<script>
function myFunction() 
{
message("The form was submitted");
}
</script>
</head>

<body>

<h1> Enter Student's information</h1>

<form onsubmit="myFunction()">

Name: <input type="text" name="studentname" required>
<br>
Age: <input type="text" name="Age" pattern="[0-9]{2}" title="Please enter 
valid age" required>
<br>
Email id: <input type="text" name="Emailid" pattern="^\w+([\.-
]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$" title="Please enter valid email …

Create a free account to keep reading this post.

and 2 others joined a min ago.

Please log in to add an answer.