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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.