Date: 08/18/00
- Next message: Bernd Neumayr: "[phplib] php4 and tree.inc"
- Previous message: Michael D. Eschner: "Re: [phplib] I get the login screen if I'm logged in"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I´ve got a real strange behaviour of a select field generated by the
OOHform class.
I load the data into a form by $f->load_defaults() an than display it.
RANDOMLY the select field is displayed with the right value selected or
the default value.
When I check the HTLM output sometimes it has the "selected" parameter
in the right option but sometimes it´s simply missing.
Did anybody else observe this behaviour? How does OOHforms decide to set
the "selected" parameter?
I think the error only occurs with options containing german special
characters like "üöä" but in most cases they just work fine.
Loading exactly the same form with the same value sometimes works
sometimes doesn´t.
I´m getting crazy on this! Any help, idea or reports of the same
problem?
Christof Beaupoil
Some Code Snippets:
//creating the form:
$o = GetOptions("col","table");//this loads my options from a database
table
$f->add_element(array("type"=>"select",
"name"=>"branche",
"options"=>$o,
"size"=>"1",
"valid_e"=>"Bitte waehlen Sie eine Branche."));
$branche = $db->f("tbl5Branche");
if($dbg){echo"branche: $branche";} // checking if "$branche has a value"
and it always has!
$f->load_defaults();
$f->formular_ausgeben($neu);
#
# the output function
#
function formular_ausgeben($neu){
global $sess;
$this->start("icER","POST",$sess->self_url());
echo "<table border=\"0\">";
echo "<TR><TD align=\"right\">*Branche:</TD><TD>";
$this->show_element("branche");
echo "</TD></TR>\n";
if($neu){
echo "<TR><TD align=\"left\">;
</TD><TD align=\"left\">";
$this->show_element("submit2",
"OK");
echo "</TD></TR>\n";
}
else{
echo "<TR><TD align=\"left\">
</TD><TD align=\"left\">";
$this->show_element("submit1",
"OK");
echo "</TD></TR>\n";
}
echo "</table>";
$this->finish();
}
// the BAD HTML output
<select name='branche' size='1'><option value='0'>Bitte wählen
<option value='Agrarwirtschaft
'>Agrarwirtschaft
<option value='Banken+Versicherungen
'>Banken+Versicherungen
// the GOOD HTML output
<select name='branche' size='1'><option value='0'>Bitte wählen
<option value='Agrarwirtschaft
'>Agrarwirtschaft
<option value='Banken+Versicherungen
' selected>Banken+Versicherungen
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Bernd Neumayr: "[phplib] php4 and tree.inc"
- Previous message: Michael D. Eschner: "Re: [phplib] I get the login screen if I'm logged in"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

