1
HI, guys. I need help on this:
//Source language
/* $select = new XoopsFormSelect("Source language",'lang1',$editform->lang1_);
for($i=1;$i<=5;$i++)
$select->addOption($i,$i);
$form->addElement($select); */
$select_lang1 = ";
for( $i = 1 ; $i <= 5 ; $i ++ ) {
$selected = $i == $question->getVar('lang1') ? "selected='selected'" : "" ;
$select_lang1 .= "n" ;
}
$select_lang1 .= "n" ;
As you can see it would show a dropdown box in the form with "i" items named from 1 to 5. What I need is a dropdown with this options:
$select_lang1->addOption("Abkhazian");
$select_lang1->addOption("Afar");
$select_lang1->addOption("Afrikaans");
$select_lang1->addOption("Albanian");
so that I'd add this: <{$select_lang1}> in the form template to get it shown.
Thanks!
Mind anchors