Hi All,
This is kind of a javascript problem because of the way I have set up the php so maybe there is a different way to do it.
I have a list of inputs in a form. They are dynamically created in a loop as array values e.g.
<? for($i=0; $i<5; $i++) { ?>
<input name="new_item_brand[]" type="text" id="brand" size="9">
<input name="new_item_ref[]" type="text" id="brand" size="9">
<? } ?>
When the form is submitted I search these inputs by:
for($i=0; $i<5; $i++)
{
$upd_query = "UPDATE quote_details SET
qte_ref = '".$qte_ref."',
item_ref = '".$item_ref[$i]."";
}
This works fine.
The problem is that I want to access the form field using javascript but it doesnt seem to like the square brackets []
<a href="#"
onClick="window.open('stocksearch.php?search='+qte_form.new_item_ref[<?=$i?>]);">
CLICK</a>
or
<a href="#"
onClick="window.open('stocksearch.php?search='+qte_form.new_item_ref[]);">
CLICK</a>
Does anyone have a solution to the javascript or a PHP solution?
Thanks for any help
Alan