[Phplib-users] select box
Brought to you by:
nhruby,
richardarcher
|
From: <so...@gm...> - 2002-05-03 13:24:06
|
is it possible to use one tpl file to select days in one box
and select months in one box?
------------------------------------
<td>{create_user_form->selectDay} {create_user_form->selectMonth}</td>
------------------------------------
<!-- start select -->
<select name="{select->name}" style="width:60px;" width="60">
<!-- BEGIN select -->
<option value="{select->value}"{select->selected}>{select->html}</option>
<!-- END select -->
</select>
<!-- end select -->
------------------------------------
$tpl->set_file ("create_user_form->selectDay", "tpl/select.tpl.html" );
// Tag
$tpl->set_block("create_user_form->selectDay", "select",
"selectDay_handle" );
for ($i=0; $i < count($ListDay); $i++) {
$selected = "";
if ($selectDay == $i) {
$selected = " selected";
}
$tpl->set_var("select->value", $i);
$tpl->set_var("select->selected", $selected);
$tpl->set_var("select->html", $ListDay[$i]);
$tpl->parse("selectDay_handle", "select", true);
}
$tpl-> set_var ( array (
"select->name" => "selectDay"
));
$tpl->set_file ("create_user_form->selectMonth", "tpl/select.tpl.html" );
// Monat
$tpl->set_block("create_user_form->selectMonth", "select",
"selectMonth_handle" );
for ($i=0; $i < count($ListMonth); $i++) {
$selected = "";
if ($selectMonth == $i) {
$selected = " selected";
}
$tpl->set_var("select->value", $i);
$tpl->set_var("select->selected", $selected);
$tpl->set_var("select->html", $ListMonth[$i]);
$tpl->parse("selectMonth_handle", "select", true);
}
$tpl-> set_var ( array (
"select->name" => "selectMonth"
));
|