Hello!
I have really searched, and while learning alot didn't find a solution to just my problem, which I don't think should be so difficult but I've been stuck many, many moons now... :queasy:
I am trying to modify some code and working with a pulldown select menu which I then want to change a picture according to what has been selected.
The pull down function is:
function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
$field = '<select name="' . tep_output_string($name) . '"';
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';
if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);
for ($i=0, $n=sizeof($values); $i<$n; $i++) {
$field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
if ($default == $values[$i]['id']) {
$field .= ' SELECTED';
}
$field .= '>' . tep_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>';
}
$field .= '</select>';
if ($required == true) $field .= TEXT_FIELD_REQUIRED;
return $field;
}[/SIZE][/COLOR]
And is then created with:
<?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?>
I don't know where or how I can grab what is selected from the menu (ie.'blue'), and then make the picture changed (to blue).
Thanks for reading so far, any help is appreciated, even just a tip in the right direction thank you!