and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
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 '[syntax="javascript"]\forum_exec5.php on line 6.
Here is the code:
[syntax="javascript"]
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();
}
}
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by phpsmart on Sat Feb 17, 2007 9:52 pm, edited 1 time in total.
Unless I'm blind, the if statement is fine... You'll have to post more of your javascript code, as after fixing the closing brace, it should have fixed your errors...