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 803293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:44:11+00:00 2026-05-14T23:44:11+00:00

i am comparing password and confirm password through java script.my code- function validate_form(thisform) {

  • 0

i am comparing password and confirm password through java script.my code-

function validate_form(thisform)
{  
with (thisform)
  {  
    if (validate_required(password,"<b>Error: </b>Password must be filled out!")==false)  
  {password.focus();return false;}

  else if (validate_required(cnfpassword,"<b>Error: </b>Confirm Password must be filled out!")==false)
  {cnfpassword.focus();return false;}

  else if (document.getElementById('password').value != document.getElementById('cnfpassword').value)
  {password.focus();Sexy.error("<b>Error: </b>Passwords entered are not same!"); 
  password.value="";cnfpassword.value="";return false;}
  }

validate_required() function is working fine, it is showing alert msg but password compare is not working. But the same code is working fine in some other page.I have written some php code to avoid page caching-

<?php
session_start();
session_cache_limiter('nocache');
header('Pragma: no-cache');
?>

what’s the problem???

  • 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-14T23:44:12+00:00Added an answer on May 14, 2026 at 11:44 pm

    Strange code !

    What does the

    with (thisform)
    

    do ?
    Does it allow to have password and cnfpassword in the current scope ?

    If so, why don’t you do :

    else if (password.value != cnfpassword.value)
    

    ?

    Apart from this, I suggest you to validate the form ALSO in PHP.

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

Sidebar

Related Questions

I've been comparing documentation for the multimap::erase function. After checking out Josuttis and cplusplus.com
In my 'Members' model, I am comparing whether password matches password_confirm through this custom
Why comparing to null is so unstable? Just code. IronRuby 0.9.4.0 on .NET 2.0.50727.4927
I'm comparing the following code in C++ and C# and C# (Mono 2.4) seems
I'm ripping my noob hair out here. Can't understand why below code isn't working.
I have to do the decryption before comparing the password. I have not used
I'm having trouble compiling some C code. When I compile, I'l get this error:
When comparing a string literal with another string literal with the == operator (or
When comparing a tuple with a list like ... >>> [1,2,3] == (1,2,3) False
When comparing doubles for equality, we need to give a tolerance level, because floating-point

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.