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

  • Home
  • SEARCH
  • 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 890267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:42:19+00:00 2026-05-15T13:42:19+00:00

Here’s my code: function validate_form(thisform) { with (thisform) { if (validate_required(name,Name must be filled

  • 0

Here’s my code:

function validate_form(thisform)
{
with (thisform)
  {
      if (validate_required(name,"Name must be filled out!")==false)
  {name.focus();return false;}
  if (validate_required(country," Country must be filled out!")==false)
  {country.focus();return false;}
  if (validate_required(state,"State must be filled out!")==false)
  {state.focus();return false;}
  if (validate_required(city,"City must be filled out!")==false)
  {city.focus();return false;}
  if (validate_required(contact,"Contact must be filled out!")==false)
  {contact.focus();return false;}
  if (validate_required(emailid,"Email must be filled out!")==false)
  {emailid.focus();return false;}
  if (validate_email(userid,"Email is not valid")==false)
  {userid.focus();return false;}
  if (validate_required(password,"pasword must be filed out")==false)
  {password.focus();return false;}
  if (validate_required(cpassword,"Password must be confirmed")==false)
  {cpassword.focus();return false;}

if(validate_required((password.value != cpassword.value),"Your password and confirmation password do not match.")==false) {
cpassword.focus();return false;


}

All other validations are working but not the last one. Why is that so and how to fix it?

  • 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-05-15T13:42:20+00:00Added an answer on May 15, 2026 at 1:42 pm

    I presume you’ve got validate_required() function from this page: http://www.w3schools.com/js/js_form_validation.asp?

    function validate_required(field,alerttxt)
    {
    with (field)
      {
      if (value==null||value=="")
        {
        alert(alerttxt);return false;
        }
      else
        {
        return true;
        }
      }
    }
    

    In this case your last condition will not work as you expect it.

    You can replace it with this:

    if (password.value != cpassword.value) { 
       alert("Your password and confirmation password do not match.");
       cpassword.focus();
       return false; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 545k
  • Answers 545k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You're using the update function wrong. It should be like… May 17, 2026 at 8:54 am
  • Editorial Team
    Editorial Team added an answer You could do a simple refactoring instead of the options… May 17, 2026 at 8:54 am
  • Editorial Team
    Editorial Team added an answer Ok you are trying to end a vector of strings,… May 17, 2026 at 8:51 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Here is my code, which takes two version identifiers in the form 1, 5,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Here is a snippet of my form <form action= method=post onsubmit=return verify()> <input type=submit
here's what I currently have, unfortunately I cannot seem to figure out how to
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote
Here's a coding problem for those that like this kind of thing. Let's see

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.