Я создаю страницу XHTML и использую php для ее генерации.Итак, теперь я создаю комбинированный список, как это:
<select id="Indexer_Backend_select" size="1" onchange="changeHidBySelect('all_id')">
<option value="nr1">nr1</option>
<option value="nr2">nr2</option>
<option value="nr3" selected="selected">nr3</option>
</select>
Итак, теперь, в некоторых случаях, он работает, а в некоторых других случаях выбирается только самый верхний слой.
Почему это?Я серьезно заблокирован, поэтому я совсем не знаю, как дальше ...
спасибо за помощь
РЕДАКТИРОВАТЬ:
-Я использую Firefox
-Я только что написал это везде, оно генерируется функцией PHP, которая выглядит следующим образом:
function createOptions($defaultvalue,$curr_path,$default_important,$only_modules) {
###############################################################################################
## String createOptions($defaultvalue string, $curr_path string, $default_important boolean, ##
## $only_modules boolean); ##
## ##
## This function returns all the Modules which can be selected in every workflow. ##
## The Return value is a string (the HTML-Code for the <select>-Wheel) ##
## ##
## $defaultvalue describes the preselected value. If none is set, the toppest (alphabetic ##
## order) is selected. For more, read param $default_important... ##
## ##
## $curr_path describes the path, on which the select's ID is based. ##
## ##
## $default_important describes, if it is important to recognize, if no default-value was ##
## given. If true, every time, no default-value was given, a little star is displayed ##
## next to the <select>. If false, this won't be displayed. ##
## ##
## $only_modules says, if the complete select tag or only all the <option>-Entrys should be ##
## returned. So, if set to true, only a list of <option>-Tags will be returned. ##
###############################################################################################
//Get global var $config... In there are the names for the options
global $config;
//Calling Global Array $config...
$options = $config["Indexer"]["Modules"]; //In here are the diffrent options
//Now creating options wheel...
$options_wheel = "";
if (!$only_modules) {
$options_wheel = "<select id=\"" . $curr_path . "_select\" size=\"1\" onchange=\"changeHidBySelect('" . $curr_path . "')\">";
}
$default_set = 0;
foreach ($options as $key => $value) {
$options_wheel .= "<option value=\"" . $options[$key]["Class"] . "\"";
if ($options[$key]["Class"] == $defaultvalue) { //in $options[$key]["Class"] are the values saved, e.g. "nr2"
$options_wheel .= " selected=\"selected\"";
$default_set = 1;
}
$options_wheel .= ">" . $options[$key]["Class"] . "<";
$options_wheel .= ($only_modules ? "\\" : "");
$options_wheel .= "/option>";
}
if (!$only_modules) {
$options_wheel = $options_wheel . "
</select><input type=\"hidden\" id=\"" . $curr_path . "_hidvalue\" name=\"" . $curr_path . "_hidvalue\" value=\"" . $defaultvalue . "\" />
";
}
if (($default_set == 0)&&($default_important == true)) {
$options_wheel .= "*";
}
return $options_wheel;
}
И если я сейчас вызываю эту функцию, яНазовите это так:
echo createOptions($value4,$options_path,true,false);
$ value4 является значением по умолчанию, для верхнего примера это будет "nr1"
Итак, и если я сейчас посмотрю код с firebug или как источник,иногда существует selected = "selected", которое работает, но в других случаях есть такое, которое просто не работает, и отображается первый элемент.