Jump to content

rwalsh0975

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rwalsh0975's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for your help, after a little fanagling, I got it to work just how I wanted!
  2. Sorry for the bump again, I just hope it gets read by someone that can help me
  3. *bump* I have thought of another approach ... is it possible to put the array as the option value... ie. $options.="<OPTION VALUE="$_GET['arrayname']">".$itemname.'</option>'; or something like that???
  4. Hey all, this is my first post and I know what I am doing wrong I am just not versed well enough in php nor javascript to find a workaround. I have the following code which makes an array based on the itemname and then populates the array with information previously received from a mysql query and this part works. while ($row=mysql_fetch_array($result)) { $id = $row["id"]; $itemname=$row["itemname"]; $upc=$row["UPC"]; $instock=$row["instock"]; $price=$row["price"]; $options.="<OPTION VALUE=\"$itemname\">".$itemname.'</option>'; ?> var $arrayname = <?php echo "'$itemname'" ?>; $arrayname = new Array(); //Create array dependent on $itemname and insert data into it. $arrayname[0] = <?php echo "'$id'" ?>; $arrayname[1] = <?php echo "'$itemname'" ?>; $arrayname[2] = <?php echo "'$upc'" ?>; $arrayname[3] = <?php echo "'$instock'" ?>; $arrayname[4] = <?php echo "'$price'" ?>; <?php } ?> I then have a drop down menu that contains all of the 'itemname's and therefore all the names of the arrays. However, the 'value' of the drop down menu items is not the array themselves, but merely the names and I pass the name to a javascript that will populate textboxes with correlated information. What I want to know is how can i manipulate it so that it will either pass the arrays themselves or once the name is passed to the js function have it determine that I want it to use the array and not merely the name of the array. Thanks in advance!!! function displayInfo(itemname){ document.inventory.instock.value = itemname[3]; //Other populating stuff } </script> <form action="availibility.php" name="inventory" method="POST"> Items in Inventory <select name=itemname onchange="displayInfo(document.inventory.itemname.value)"> <option value=0> <?=$options?> </option> </select>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.