Re: Looks like a bug with Smarty

From: Date: Fri, 18 Jan 2008 07:32:51 +0000
Subject: Re: Looks like a bug with Smarty
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-267530@lists.php.net to get a copy of this message
if ($question == 'php') domail('phplist',$question); if ($question == 'smarty') domail('smartylist',$question);
Hi All, I using html_options smarty tag to output an associative array in select drop down. Here a sample associative array: array(5) { ["CN-PEK-KEJ"]=> array(1) {
    [198]=>
    string(7) "TechTst"
} ["IE-DUB-GAS"]=> array(2) {
    [177]=>
    string(10) "store room"
    [39]=>
    string(10) "TechStop 2"
} ["UK-LON-BEL"]=> array(1) {
    [88]=>
    string(16) "TechStop-LON-BEL"
} ["IE-DUB-GOR"]=> array(1) {
    [159]=>
    string(10) "TechStop 1"
} ["US-NYC-9TH"]=> array(1) {
    [194]=>
    string(12) "TestTechStop"
} } and the syntax I have used to output this was: {html_options name='locationId' options=$locations selected=$selectedLocation} where in I assign $selectedLocation with one of the options after selecting them. Even after everything being right, the option thats been selected is not set but it again goes back to show the first option after submit. Looks like either smarty misinterprets this selected option or is there something wrong from my end. Cheers


« previous php.general (#267530) next »