Jump to content

Javascript If statements?


sync2007

Recommended Posts

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();

}

 

Link to comment
https://forums.phpfreaks.com/topic/38994-javascript-if-statements/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.