Jump to content

IE JavaScript Error Expecting "(" on Line 9


suttercain
 Share

Recommended Posts

Hi Everyone,I am not that familiar with JavaScript but I am trying to use a script that uses it. I know more PHP than JavaScript. I was hoping someone could assist me.Here is the code I am running:

echo"	<form action=\"".$forumpath."/login.php\" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)>	<script type=text/javascript src=\"".$forumpath."/clientscript/vbulletin_md5.js\"></script>";	?><table width="350" border="0" cellspacing="0" cellpadding="2">  <tr>    <td><font size='2'>User Name</font></td>    <td><?php echo "<input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '$vbphrase[username]') this.value = ''; size=10 />"; ?></td>    <td><?php echo "<label for=cb_cookieuser_navbar><input name=cookieuser type=checkbox id=cb_cookieuser_navbar value=1 checked=checked /><font size='2'>	Remember Me?</font></label>"; ?></td>  </tr>  <tr>    <td><font size="2">Password</font></td>    <td><?php echo "<input name=vb_login_password type=password size=10 />"; ?></td>    <td><?php echo "<input type=submit title=$vbphrase[enter_username_to_login_or_register] value=\"Log In\" />"; ?>    <td colspan="2"><?php echo "	<a href=\"".$forumpath."/register.php?s=$session[sessionhash]\"	target=\"_parent\"><font size='2'><b>register</b></font></a>	"; ?></td>

This is the error I am getting when I run IE "JavaScript Error Expecting "(" on Line 9" This only happens in IE but runs and executes in Firefox with no issue.Can someone tell me if there is a way to resolve this?Thank you in advance for your time.SC

Link to comment
Share on other sites

<input name=vb_login_username type=text id=navbar_username onfocus="if (this.value == '$vbphrase[username]') this.value = '';" size=10 />

At onfocus you forgout to wrap your code in " ".I recommend you to always use " " for properties (name, type, title...).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...