My Javascript does not execute, does anyone know why? -


could please me code?

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>welcome daily news</title> <script type="text/javascript" src="scripts.js"> </script> <link href="homepage.css" rel="stylesheet" type="text/css" /> </head>  <body>  <div class="body"> <div class="header"> <a href="#" title="home"><img id="header-image" src="news_logo.png" /></a>  <form id="login-form" action="customerlogin.html" method="post" onsubmit="return validate(this)">    <table>     <tr>      <td><label for="loginid">login:</label></td>      <td id="login-form"><input id="login-boxes" type="text" id="loginid"></td>        <td><label for="pword">password:</label></td>       <td id="login-form"><input id="login-boxes" type="password" id="pword"></td>     </tr>      <tr>      <td></td>      <td id="login-buttons"><input type="submit" value=" sign in ">        <input type="reset" value="clear form">        </td>     </tr>     </table>   </form>  </div>   </div> </body> </html> 

my javascript is:

function validate(loginform) {  var boovalid = true;  var strerrormessage = "";  var minlength=5;  var maxlength=10;   if(loginform.pword.value.length < minlength)  {   strerrormessage = "password must @ least 5 characters\n";   boovalid=false;  }   if(loginform.pword.value.length > maxlength)  {   strerrormessage = "pasword must not more 10 characters\n";   boovalid=false;  }     if(loginform.loginid.value.indexof("@") == -1)  {   strerrormessage = "please enter e-mail address login name\n";   boovalid=false;  }   if(!boovalid)  {   alert(strerrormessage);  }   return boovalid; } 

i couldn't figure out code, doesn't seem read javascript @ all.

i have no idea why not. i've tried use login form , javascript works , when put doesn't work.

  1. you want replace every id= class=
  2. instead of later ids want use name

    <input id="login-boxes" type="text" id="loginid"> <input id="login-boxes" type="password" id="pword"> 

    to

    <input class="login-boxes" type="text"     name="loginid"> <input class="login-boxes" type="password" name="pword"> 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -