Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Message: Missing ; Before Statement

Status
Not open for further replies.

getjbb

MIS
Jun 4, 2003
139
US
I am getting back the error: Missing ; before statement


chkBox.innerHTML = "<input type=checkbox onclick=is_checked() id="cbox + index" name="cbox + index">"+field1+"";

And it is pointing to the cbox that is bolded.

Whatever help given will be appreciated.

The piece of code is within a function and the index variable is calculated and the field1 variable is being passed in.

getjbb
 
The " before cbox signifies the end of the string.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
As pointed out above your string is incorrectly constructed.

To Js your string ends when it finds a second set of double quotes, so it expects a semi colon to end the instruction before anything else.

Code:
chkBox.innerHTML = "<input type=checkbox onclick=is_checked() id='cbox + index' name='cbox + index'>"+field1+"";

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top