2

here is the script

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++) {
    $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
    if ($default == $values[$i]['id']) {
      $field .= ' selected="selected"';
    }

    $field .= 'disabled>' . tep_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', ' disabled >' => '&gt;')) . '</option>';
  }
  $field .= '</select>';

  if ($required == true) $field .= TEXT_FIELD_REQUIRED;

  return $field;
}

In $field I'm trying to place "disabled" attribute to disable particular options from selecting but the drop down hide the options instead of disabling them.

when I view the source I can see the "disabled" attribute placed in the options so my code executes fine.

I think I'm not placing this attribute on right place any help will be much appreciated

Muhammad Asif Raza
  • 647
  • 2
  • 5
  • 24

1 Answers1

0

I found problem in your code.

 tep_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', ' disabled >' => '&gt;'))

check again.