Full Stack Asssignment
Full Stack Asssignment
Aim: Client-side Form Validations using JavaScript, DOM real-time update, JQuery
to develop Ajax based applications.
Objectives:
1. To understand what form validation is.
2. To learn basic functioning of DOM objects.
3. To learn how to apply various techniques to implement it.
Theory:
FAQ:
1. Write 3 reasons why Form validations are important.
Form validations are crucial for several reasons:
1.Improved User Experience: They provide immediate feedback to users, helping them
correct errors before submitting the form, which reduces frustration and ensures a
smoother interaction.
2.Data Integrity: Validations ensure that the data entered into the form meets the required
formats and criteria, maintaining the accuracy and consistency of the information
collected.
3.Security: Proper form validations help prevent malicious inputs, such as SQL injection
or cross-site scripting (XSS) attacks, by ensuring that the data meets the expected
standards before being processed.
Write a program to design Student registration form by using HTML, CSS having following
fields: Username, Email, Phone number, Password, Confirm Password and write external
javascript code to achieve following validations
● Fields should not be empty. If spaces are entered those should be considered empty
● Phone number must accept only numeric values and it should be 10 digits
● Password length must be at least 7 and it should contain at least one capital letter, one
digit and one special character from the set (&,$,#@)
● Value entered in password field and confirm password fields must match
Email address must contain @ sign and a ., there should be few letters before the @ sign, there
should be three letters between @ sign and a . There must be 3 or 2 letters after the . (hint: Use
regular expression)
Write a client-side script with JavaScript to access and manipulate Document Object Model
(DOM) objects in an HTML web page. Develop a dynamic web page using javascript and DOM.
Make use of the following for accessing elements
● getElementById, getElementsByTagName,getElementsByClassName
● Change the text using innerHTML property
● Change the CSS properties like color, position of a particular element on the page
● Change the image source after clicking on a button
● Add a text node and attach it to a parent node
● Delete a node