display message on wrong password entry

user3487121

I have a submit button which only works when "victory" is typed into the form. Now I am trying to work on an error message to display "wrong keyword entry" if the text entered into the form field isn't "victory". here is the code

<form name="input" action="index.html" method="post" onsubmit="return check();">
<input type="text" maxlength="7" autocomplete="off" name="" id="victory">

<br><input type="submit" class="bigbutton"  value="NEXT">

</form>    
<script>

function check(){
if(document.getElementById("victory").value == "victory")
    return true;
else 
   return false;

}

ElliotSchmelliot

If I were you I'd add an HTML element to stuff an error into. Then you can style it with CSS however you'd like.

<div id="error"></div>

Then your function would look something like this:

function check(){
    if(document.getElementById("victory").value == "victory")
        return true;
    else 
        document.getElementById("error").innerHTML = "Wrong keyword entry."
        return false;
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Wrong Password Alert Message Does Not Show Up

From Dev

How to fix login page Laravel ui auth didn't display any error message when wrong input email/password

From Dev

How to display a video when a wrong password is entered

From Dev

angularjs password confirmation not display confirmation message

From Dev

lock application on wrong password entry (c/c++)

From Dev

Why Windows takes longer time to report a wrong password entry?

From Dev

login button entry activity even if the password is wrong , Retrofit 2

From Dev

The alert for wrong password keeps displaying, even after I click ok using Javascript. How do I stop this continuous display of the alert message

From Dev

Devise display incorrect username, email, or password error message

From Dev

How can we display the form validation message inside the password box?

From Dev

How do I display login message such as password expiry warning?

From Dev

Display Error message when connection or Invalid Username or Password in VBA

From Java

How do I display an error message if the input is wrong on HTML

From Dev

Laravel 5 confirmation error message display in wrong field

From Dev

User-Signup Form - Getting Error Messages to Display On Wrong Entry Only

From Dev

I want to send OTP message to . But while i enter user name and password it's showing wrong user name and password

From Dev

I want to send OTP message to . But while i enter user name and password it's showing wrong user name and password

From Dev

when user enter wrong username and password while login it did not flash any error message in ROR

From Dev

Message on successful database entry

From Dev

Message on successful database entry

From Dev

Catch wrong password

From Dev

MATLAB GUI: I want to display an error message if user selects the wrong file type

From Dev

Secure PHP password entry possible?

From Dev

security model of Linux password entry

From Dev

Password confirmation message

From Dev

Entry Validation going wrong with tkinter

From Dev

MySQL Duplicate entry, but a wrong string

From Dev

XDT transformation removes wrong entry

From Dev

Anything wrong with this trap message?

Related Related

  1. 1

    Wrong Password Alert Message Does Not Show Up

  2. 2

    How to fix login page Laravel ui auth didn't display any error message when wrong input email/password

  3. 3

    How to display a video when a wrong password is entered

  4. 4

    angularjs password confirmation not display confirmation message

  5. 5

    lock application on wrong password entry (c/c++)

  6. 6

    Why Windows takes longer time to report a wrong password entry?

  7. 7

    login button entry activity even if the password is wrong , Retrofit 2

  8. 8

    The alert for wrong password keeps displaying, even after I click ok using Javascript. How do I stop this continuous display of the alert message

  9. 9

    Devise display incorrect username, email, or password error message

  10. 10

    How can we display the form validation message inside the password box?

  11. 11

    How do I display login message such as password expiry warning?

  12. 12

    Display Error message when connection or Invalid Username or Password in VBA

  13. 13

    How do I display an error message if the input is wrong on HTML

  14. 14

    Laravel 5 confirmation error message display in wrong field

  15. 15

    User-Signup Form - Getting Error Messages to Display On Wrong Entry Only

  16. 16

    I want to send OTP message to . But while i enter user name and password it's showing wrong user name and password

  17. 17

    I want to send OTP message to . But while i enter user name and password it's showing wrong user name and password

  18. 18

    when user enter wrong username and password while login it did not flash any error message in ROR

  19. 19

    Message on successful database entry

  20. 20

    Message on successful database entry

  21. 21

    Catch wrong password

  22. 22

    MATLAB GUI: I want to display an error message if user selects the wrong file type

  23. 23

    Secure PHP password entry possible?

  24. 24

    security model of Linux password entry

  25. 25

    Password confirmation message

  26. 26

    Entry Validation going wrong with tkinter

  27. 27

    MySQL Duplicate entry, but a wrong string

  28. 28

    XDT transformation removes wrong entry

  29. 29

    Anything wrong with this trap message?

HotTag

Archive