0% found this document useful (0 votes)
25 views2 pages

Web App Development Exercise 6

The document outlines an assignment for web app development focusing on JavaScript validations for a user account creation form. It includes HTML code for input fields such as first name, last name, email, password, and phone number, and specifies the use of HTML5 attributes like placeholder, required, and pattern. Additionally, it requires the implementation of a validate() JavaScript function to ensure proper input validation before form submission.

Uploaded by

Prasann M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Web App Development Exercise 6

The document outlines an assignment for web app development focusing on JavaScript validations for a user account creation form. It includes HTML code for input fields such as first name, last name, email, password, and phone number, and specifies the use of HTML5 attributes like placeholder, required, and pattern. Additionally, it requires the implementation of a validate() JavaScript function to ensure proper input validation before form submission.

Uploaded by

Prasann M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CSA -202 Web App Development

Assignment 6 : (JavaScript validations)

<html>

<head></head>
<body>
<center>
<h1 style="color: green;">
Create Account
</h1>
<h3>
Validate Input Fields
</h3>
<form action="#" method="post">
<label for="fname">First Name:</label>
<input type="text" name="fname" id="fname">
<br><br>
<label for="lname">Last Name:</label>
<input type="text" name="lname" id="lname" >
<br><br>
<label for="email">Email Id:</label>
<input type="email" name="email" id="email" >
<br><br>
<label for="password">Password:</label>
<input type="password" name="password" id="password" >
<br><br>
<label for="phone">Phone Number:</label>
<input type="tel" name="phone" id="phone" >
<br><br>
<input type="submit" value="Submit">
</form>
</center>
</body>
</html>

Refer the above forms.html document and:

a) Use HTML 5 attributes : Placeholder, required and pattern.

b) Write validate() JavaScript function to validate First name and Last


name for empty values, Email and phone number for valid values and
password of 8 characters including alphabets, numbers and few special
characters. (Hint: Use simple validations for first name, lastname and
use regular expressions for email, password and phone)

c) Call the validate() function for onsubmit event handler of the form.

You might also like