Forum Moderators: coopster
I am modifying the osCommerce to fit my needs and have a general PHP question/issue....
The system is an popup menu which is propagated as an array name:
<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute);?></td>
so if you look at the popup item in say dreamweaver and click on one of the popups it shows a name of id[1], etc.
However, I have added a line of code so that a link will be displayed next to the popup which when clicked will open a window and display more information about whet is the currently selected popup item...
The problem is that when I try to pass the item as document.forms.cart_quantity.id[2].... the javascript does not like that . However, if I change the code above to make the popname id_1 the popup code works... BUT, the store breaks!
My question is how can I access the name of the array id[2] and pass the name of that form object to a javascript?
Thanks in advance....
Rob
In this script I want to received the popup menu item which is currently selcted as the variable. This script will open a window based on that id.
<script language="JavaScript" type="text/JavaScript">
<!--
function clickMe(theID) { //v2.0
... code to get value & open window ...
}
//-->
</script>
Here is the popup menu in a form which has a name that is also an array (for other use). The click link will send the clickMe script the currently selected popup value...
Remember that this is one of many popups on the page...
<form name="form1" method="post" action="">
<select name="id[0]" id="id[0]">
<option value="1">one</option>
<option value="2">two</option>
</select>
<a href="#" onClick="clickMe('id[0]')">click</a>
</form>
The problem is that when I try to pass the item as document.forms.cart_quantity.id[2].... the javascript does not like that . However, if I change the code above to make the popname id_1 the popup code works... BUT, the store breaks!
Could you change it to the id_1, id_2, etc. but at the beginning of the store script convert the id_x vars into the id[x] array that it's looking for?
baze