I have a PHP 5.6 website and i don’t know which version of jQuery is included but my jQuery UI version is “version”: “1.12.0” lets consider i have some old jQuery and CSS versions.
I have a and options inside it which is generated dynamically using PHP and i have tested it the generation of the these options are correct.
Here is the function for generating the options.
`function tep_draw_pull_down_menu($name, $values, $default = ”, $parameters = ”, $required = false) {
global $HTTP_GET_VARS, $HTTP_POST_VARS;
$field = '<select name="' . tep_output_string($name) . '"';
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';
if (empty($default) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
$default = stripslashes($HTTP_GET_VARS[$name]);
} elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
$default = stripslashes($HTTP_POST_VARS[$name]);
}
}
for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
$style = '';
if($values[$i]['bold'] == 1){
$style = 'style="font-weight:bold;"';
}
$field .= '<option '.$style.' value="' . tep_output_string($values[$i]['id']) . '"';
if ($default == $values[$i]['id']) {
$field .= ' selected="selected"';
}
// $text = html_entity_decode($values[$i]['text']); PHP 5.6 code
$text = html_entity_decode($values[$i]['text'] ?? '');// PHP 8.2
$field .= '>' . tep_output_string($text, array('"' => '"', ''' => ''', '<' => '<', '>' => '>')) . '</option>';
}
$field .= '</select>';
if ($required == true) $field .= TEXT_FIELD_REQUIRED;
return $field;
}`
The issue is when i’m running php 5.6 the select options are working fine and correct but as i change my php version from 5.6 to 8.2 my select and options are overflowed means showing all the options which is about 2 to 3 thousand records which i don’t want to show it directly
I’m expecting and want to show the select option when clicked then i want to show the my options
Hilal Ahmad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.