Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:24:08+00:00 2026-06-15T10:24:08+00:00

I am trying to run a form validation on an HTML form to make

  • 0

I am trying to run a form validation on an HTML form to make sure the person has filled out the two fields. I put together a JSFiddle here:

http://jsfiddle.net/yCqqj/

It has worked previously for me and I don’t know what’s going on now. I made a JSFiddle to pull it out of my site to make sure nothing else was conflicting with it but I’m realizing now that it’s something in the code. The two fields are name “emailaddress” and “Name” respectively and it looks like I’m checking their values correctly. Basically, I’m looking for an alert (and NOT a submittal of the form) if they’ve left either field blank. Thanks for helping me track down the problem. I appreciate it.

function ValidateForm(){
    var emailID=document.MailingList.emailaddress
    var nameID=document.MailingList.Name

        if ((nameID.value==null)||(nameID.value=="")){
        alert("Please Enter your Name");
        nameID.focus();
        return false;
    }

    if ((emailID.value==null)||(emailID.value=="")){
        alert("Please Enter your Email ID");
        emailID.focus();
        return false;
    }
 }

​
Even though there is not return true, the form still submits.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:24:09+00:00Added an answer on June 15, 2026 at 10:24 am

    the problem is that you haven’t defined ValidateForm in the Head section.
    i have edited the jsfiddle.check demo.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out why my form validation run function is returning false.
I'm trying to make a div fade out with jquery after the form validates
I am trying to figure out where to put validation in my N-Tier Asp.net
I have a form that I'm trying to run some basic validation on using
Hey guys, I am trying to run a proccess by submitting an AJAX form:
I am trying to generate a form at run-time. I have ended up with
I have run into a problem trying to modify a form I myself have
I'm trying to figure out how I can define validation rules for my domain
I am trying to set up validation on a simple contact form that is
Im trying my first form validation with PHP. I need some guidance with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.