0 3

BIT251 ยท 0 ยท 10 marks

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]

Web Technology IChapter 8: JavaScript Events and Form ValidationForm validation concept and purpose

--- 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...