Results 1 to 3 of 3

Thread: browser cannot find the function even though it is present...help

  1. #1
    Join Date
    Oct 2010
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default browser cannot find the function even though it is present...help

    HI,

    I have written following code.... The problem is that onmousemoveover is not working..

    the error console shows...

    "login is not a function" line 1...
    plz help...

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Home</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-5" />
    <link rel="stylesheet" type="text/css" href="css/style.css" />
      <style type="text/css">
      #popupbox{
      margin: 0; 
      margin-left: 0; /* This gets it relatively center on the screen */
      margin-right: 0; /* This gets it relatively center on the screen */
      margin-top: 10px; /* Makes it a little off the top of the screen */
      padding-top: 10px; /*  Make the text not touching the top on the login box */
      width: 20%; /* For centering it on the screen */
      height: 150px; /* The height of the login box */
      position: absolute; /* Makes sure its absolute so it doesn't dock with everything else */
      background: #CCCCCC; /* Login Box background color. Change this if desired. */
      border: solid #000000 2px; /* Makes a black border around the login box */
      z-index: 9; /* Makes it on top of everything else */
      font-family: arial; /* Sets the font */
      visibility: hidden; /* Makes it hidden at first. Very Important.*/
      }
      </style>
     <script language="JavaScript" type="text/javascript">
      function login(showhide){
        if(showhide == "show"){
            document.getElementById('popupbox').style.visibility="visible"; /* If the function is called with the variable 'show', show the login box */
        }else if(showhide == "hide"){
            document.getElementById('popupbox').style.visibility="hidden"; /* If the function is called with the variable 'hide', hide the login box */
        }
      }
      </script>
    </head>
    <body>
    		<strong><a href="javascript:login('show');" onMouseOver="login('show');" style="color:#807F7F;text-decoration:none;">Customer Login</a></strong>
    						<div id="popupbox"> <!--Start login box-->
    			<form name="login" action="./lib/checkLogin.php" method="post">
    			<center>Username:</center>
    
    			<center><input name="txt_username" size="14" /></center>
    			<center>Password:</center>
    			<center><input name="txt_password" type="password" size="14" /></center>
    			<center><input type="submit" name="submit" value="login" /></center>
    			</form>
    			<br />
    			<strong><center><a href="javascript:login('hide');" style="color:#807F7F;text-decoration:none;">close</a></center></strong> <!-- Closes the box-->
    
    			</div> <!--End login box-->
    
    </body>
    </html>
    plz help...

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    you have a function named login and a form named login,

    change one and it works

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Home</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-5" />
    <link rel="stylesheet" type="text/css" href="css/style.css" />
      <style type="text/css">
      #popupbox{
      margin: 0;
      margin-left: 0; /* This gets it relatively center on the screen */
      margin-right: 0; /* This gets it relatively center on the screen */
      margin-top: 10px; /* Makes it a little off the top of the screen */
      padding-top: 10px; /*  Make the text not touching the top on the login box */
      width: 20%; /* For centering it on the screen */
      height: 150px; /* The height of the login box */
      position: absolute; /* Makes sure its absolute so it doesn't dock with everything else */
      background: #CCCCCC; /* Login Box background color. Change this if desired. */
      border: solid #000000 2px; /* Makes a black border around the login box */
      z-index: 9; /* Makes it on top of everything else */
      font-family: arial; /* Sets the font */
      visibility: hidden; /* Makes it hidden at first. Very Important.*/
      }
      </style>
     <script language="JavaScript" type="text/javascript">
      function login1(showhide){
        if(showhide == "show"){
            document.getElementById('popupbox').style.visibility="visible"; /* If the function is called with the variable 'show', show the login box */
        }else if(showhide == "hide"){
            document.getElementById('popupbox').style.visibility="hidden"; /* If the function is called with the variable 'hide', hide the login box */
        }
      }
      </script>
    </head>
    <body>
            <strong><a href="javascript:login('show');" onMouseOver="login1('show');" style="color:#807F7F;text-decoration:none;">Customer Login</a></strong>
                            <div id="popupbox"> <!--Start login box-->
                <form name="login" action="./lib/checkLogin.php" method="post">
                <center>Username:</center>
    
                <center><input name="txt_username" size="14" /></center>
                <center>Password:</center>
                <center><input name="txt_password" type="password" size="14" /></center>
                <center><input type="submit" name="submit" value="login" /></center>
                </form>
                <br />
                <strong><center><a href="javascript:login('hide');" style="color:#807F7F;text-decoration:none;">close</a></center></strong> <!-- Closes the box-->
    
                </div> <!--End login box-->
    
    </body>
    </html>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Oct 2010
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Thanks Alot

    Thanks its solved..........

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •