sync2007 Posted February 18, 2007 Share Posted February 18, 2007 Hello everybody... I dont know what is wrong in this if statement when i click on the button which is supposed to call this function this error message appears: Parse error: parse error, unexpected '[' in C:\AppServ\www\forum_exec5.php on line 6. Here is the code: function validate() { //line 6// if ((document.forms[0].elements[0].value='') && (document.forms[0].elements[1].value='')) { alert('You must enter the topic title and details') } else { document.forms[0].submit(); } Quote Link to comment Share on other sites More sharing options...
fenway Posted February 18, 2007 Share Posted February 18, 2007 Well, you definitely mean to use == not =... but I don't see a parse error (assuming that comment isn't there). Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted February 18, 2007 Share Posted February 18, 2007 parse errors are PHP errors not javascript errors. You sure that is line 6. How is that javascript code implemented in to your PHP script? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.