Home > Back-end >  The JSP form validation of to test whether two password input problem
The JSP form validation of to test whether two password input problem

Time:10-10

Excuse me everybody does anyone know why my code to run after the two password is consistent or not, will display the password twice inconsistent?

CodePudding user response:

You add a double quotes is string, not variable, and the last is true is not true

CodePudding user response:

Is this your javascript, not JSP ah,,,
You compare the "pw1", "pw2," not pw1, pw2 the value of a variable

CodePudding user response:

Finally an if condition, what you write is:
 if (" pw1 "!="pw2") 
, variable names with quotes, becomes a two variable name string comparison, the results must be true, so once didn't meet the above conditions, at the end of the judgment will pop up two password is not consistent,
You change to the
 if (pw1!=pw2) 
  • Related