Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
Form Validation in JQuery Mobile

I'm trying to add validation to the form I made

<fieldset>
    <legend>ENTER YOUR INFORMATION HERE FOR DELIVERY</legend>
    <form action="" name="deliveryform">

          Name* :<input type="text" name="name" id="name">

          Phone Number* : <input type="text" name="phonenumber" id="phonenumber">
          <span id="warning1"></span>

          Address* : <textarea name="address" id="address" required></textarea>

          Email* : <input type="text" name="email" id="email">
          <span id="warning2"></span>

          <input type="submit" id="submitbutton" value="Submit" onsubmit=" return validation()">
                    </form>
</fieldset>

Javascript

function validation()
{
    var name = document.getElementsByName("name").value;
    var phonenumber =document.getElementsByName("phonenumber").value;
    var email = document.getElementById("email").value;
    var emailformat = "[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$";

    if(name == ""|| null)
    {
        alert("Please Enter Your Name!");
        return false;
    }

    if(isNaN (phonenumber))
    {
        document.getElementById("warning1").innerHTML ="Enter numbers only";
        return false;
    }

    if(!email.match(emailformat))
    {
        document.getElementById("warning2").innerHTML="Please enter the correct format. Example : Abc1234@gmail.com"
        return false;
    }

    else
    {
        alert("Submitted Successfully")
    }
}

Nothing changed except ''Error Loading Page '' message appeared. Did I miss something?

I thought coding in without and with Jquery in HTML is the same thing..

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!