Ask Question
23 June, 09:15

g Fill the validateForm function to check that the phone number is 10 characters long and that the user name is less than 11 characters long. Display "Phone number is invalid" and/or "User name is invalid" in the console log if the check does not pass. Use the preventDefault function to avoid submitting the form when the inputs are invalid.

+2
Answers (1)
  1. 23 June, 10:15
    0
    function validateForm (event)

    {

    event. preventDefault ();

    var phoneNumber = form. phoneNumber. value;

    var userName = form. userName. value;

    if (phoneNumber. length!=10)

    console. log ("Phone Number is Invalid");

    if (userName. length<11)

    console. log ("User Name is Invalid"); }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “g Fill the validateForm function to check that the phone number is 10 characters long and that the user name is less than 11 characters ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers