Jump to content

Why the alert message is not appear


shebbycs

Recommended Posts

<html>
<head>
<script type="text/javascript">
  function a()
{
   var x = document.register.username.value;
   var y = document.register.pass.value;
   var z = document.register.pass2.value;
   
   if(x==''&& y==''&& z='')
   {
    alert("Please insert an message!");
   
   }

}
</script>
</head>
<body>


  <form name="register" method="post" action="login.php"  onsubmit="return a()">
  <table border='0'>
  <tr><td>Username:</td><td><input type='text'name='username' maxlength='60'></td></tr>
  <tr><td>Password:</td><td><input type='password' name='pass' maxlength='10'></td></tr>
  <tr><td>Confirm Password:</td><td><input type='password' name='pass2' maxlength='10'></td></tr>
  <tr><th colspan=2><input type='submit' name='sub' value='Register'></th></tr> </table>
  </form>
  </body>
</html>

 

 

why the please insert the message box is not appear when all the 3 text file is empty?

Link to comment
https://forums.phpfreaks.com/topic/250144-why-the-alert-message-is-not-appear/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.