patlegris Posted August 19, 2006 Share Posted August 19, 2006 Hello,I'm trying to find a solution to split on different rows a long text being displayed in pulldown menu (text populated from sql).I tried the following but it didn't work :[code]// Output a form pull down menu function tep_draw_pull_down_menu3($name, $values, $default = '', $parameters = '',$required = false) { $field = '<select id="' . tep_output_string($name) . '" name="' . tep_output_string($name) . '"onChange="majOption(this)"'; if (tep_not_null($parameters)) $field .= ' ' . $parameters; $field .= '>'; if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]); $field.='<option value="SELECTION">'.SELECT.'</option>'; 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'; } ///HERE IS THE WRAPPING///// $test=wordwrap ($values[$i]['text'],5,"<BR />", 1); //$field .= '>' . tep_output_string($test, array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>'; $field .= '>' . $test .'</option>'; } $field .= '</select>'; if ($required == true) $field .= TEXT_FIELD_REQUIRED; return $field; }[/code]Any idea how could I do ?ThanksPat Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.