0 3

Web Technology I010 marksForm validation concept and purpose

Create a HTML form with fields like username, password, email, country. The username should be textbox, password and email should be the password and email fields. The country should be drop down. Now write JavaScript function for form validation. Your function should validate the username to be of

Create a HTML form with fields like username, password, email, country. The username should be textbox, password and email should be the password and email fields. The country should be drop down. Now write JavaScript function for form validation. Your function should validate the username to be of length 5, password should start with digit and should be alphanumeric. The email should be valid. The country field should be selected.[10]

--- Field Rule demanded by the question How the function checks it --------- Username Length must be exactly 5 username.length !== 5 after an empty check Password Must start with a digit and be alphanumeric passwordPattern.test(password), where the pattern anchors a leading digit followed by lett...

Up nextDescribe the client server architecture and its types.