Am using the following code.
<script language="JavaS cript1.2">
function setquantity(pro ductindex,produ ctquantity)
{
//create the reference object
irefname_none = eval("document. " + productindex + "none");
<snip>
and set quantity is called as follows further on in the HTML
<snip>
<td><img style="filter:a lpha(opacity=20 );-moz-opacity:0.2"
name="1_none" src="none.gif" onclick="setqua ntity('1','none ')" /></td>
<snip>
when I run this, the javascript console shows me an error as follows
Error Missing ; before statement
Line 9
document.1none
Line 9 is the eval line. As a test, if I remove the productindex from
the eval statement it works fine, so doesn't seem to like
productindex, despite a string being passed.
Any suggestions appreciated. Testing and developing this on Mozilla
1.2.1, Linux
Regards
Simon
<script language="JavaS cript1.2">
function setquantity(pro ductindex,produ ctquantity)
{
//create the reference object
irefname_none = eval("document. " + productindex + "none");
<snip>
and set quantity is called as follows further on in the HTML
<snip>
<td><img style="filter:a lpha(opacity=20 );-moz-opacity:0.2"
name="1_none" src="none.gif" onclick="setqua ntity('1','none ')" /></td>
<snip>
when I run this, the javascript console shows me an error as follows
Error Missing ; before statement
Line 9
document.1none
Line 9 is the eval line. As a test, if I remove the productindex from
the eval statement it works fine, so doesn't seem to like
productindex, despite a string being passed.
Any suggestions appreciated. Testing and developing this on Mozilla
1.2.1, Linux
Regards
Simon
Comment