Click to See Complete Forum and Search --> : <A href problem in Tables, Help


clyde
05-07-2003, 09:58 AM
Can somebody help

Please Refer to The Bottom code for reference

When I click on ADD the HTML does what I want it to do except it dose not use the cell data in the row I selected but the last row of the table. How Can I force the cell data in the row I have selected to be returned to the CGI Pgm.



<!-- *** ADD CART ***-->
function add_cart (obj,index)
{
alert("got to add cart");
var qindex = eval('document.Iform.Mfgqty_'+index);
alert(qindex.value);

window.open("/infcgilibp/isl550.pgm?mfgno=/%mfgnum%/&mfgdes=/%mfgdesc%/&mfgqty="+qindex.value,
"Iform1", "scrollbars,status,top=10,left=70,height=500,width=760");
return;
}



<tr>
<td><FONT size="-1"><a name="/%Mfgx%/">/%Mfg%/</a></FONT></td>
<td><FONT size="-1">/%Mfgdesc%/</FONT></td>
<td><FONT size="-1">/%Mfgnum%/</FONT></td>
<td><FONT size="-1">/%Mfgprice%/</FONT></td>
<td><FONT size="-1"><INPUT size="4" type="text" maxlength="4" name="/%Mfgqty%/"></FONT></td>
<td valign="middle" align="center"><FONT size="-1"><A href="javascript:add_cart(/%xxx%/);">Add</A></td>
</tr>

khalidali63
05-07-2003, 10:24 AM
To make your life easier,I'd sauggest you added check boxes in all of hte rows,and select a check box for the line you want to add.

that way you can find out the row and then get value from the table cell to pass it on to the add function.

clyde
05-07-2003, 12:11 PM
Do you have an example of the check boxes and how the data from the row that is checked mark.

thanks

Clyde