Correcting Javascript If statements?
Posted: Sat Feb 17, 2007 9:19 pm
feyd | Please use
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
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();
}
}
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
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]