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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:40:34+00:00 2026-05-11T05:40:34+00:00

If the user name and password do not match it displays an alert but

  • 0

If the user name and password do not match it displays an alert but if I click ok to the alert the form is logged in. Can anyone tell me how to avoid it? Thanks.

<html> <f:view> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <h:form id="loginForm"> <h1><center>Login page</center> </h1> <h:panelGrid columns="2"> <h:outputLabel value="UserName"></h:outputLabel> <h:inputText id="name" value="#{user.name}"> </h:inputText> <h:outputLabel value="Password"></h:outputLabel> <h:inputSecret id="password" value="#{user.password}"></h:inputSecret> </h:panelGrid> <h:commandButton type="button" value="Login" action="logged" onclick="checkPassword(this.form)"></h:commandButton> </h:form> </body> <script type="text/javascript"> <!-- function checkPassword(form) { var passsword = form["loginForm:password"].value; var username=form["loginForm:name"].value; var confirmpassword ="welcome"; var confirmusername="admin"; if((passsword == confirmpassword)&&(username==confirmusername)) form.submit(); else alert("Username and Password does not match"); } --> </script> </f:view> </html> 
  • 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. 2026-05-11T05:40:35+00:00Added an answer on May 11, 2026 at 5:40 am
    ... onclick='checkPassword(this.form); return false;' ... 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have mail server configuration data (server - user name - password - port)
My program takes user name and password authentication from user before initialising the program,
On websites where you have to enter a user name and password, I notice
I have text to localize like this <p>Please enter your user name and password.
I've created a user login dialog box that compares the user's name and password
I have a typical User model (username, password, name, etc). I want to allow
Consider this: class User < ActiveRecord::Base # name, email, password end class Article <
I have a user registration form that has a password and confirm password field.
I have this script through which I can change my LDAP password but I
I have created a form and have validated everything using PHP, but can't figure

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.