HI David Zülke ,


Just see my code. I have written this code to populate list in a select box
from DB.

*Here is the code*

* *

*Template file*

<select name="qstID" >

 <option value="0" >Select</option>

  *<?*

   *while*( $row=mysql_fetch_array($template[*'qstlist'*]) )

   {

     *if*($userDt[*'qstID'*]== $row[*'qstID'*]){

     *echo*"<option value=".$row[*'qstID'*]." selected >".$row[*'qst'*].
"</option>";

     }

     *else*{

     *echo*"<option value=".$row[*'qstID'*].">".$row[*'qst'*]."</option>";

     }

   }

  *?>*

</select>



*Action file*

*public* *function* executeRead(AgaviRequestDataHolder $rd)

     {

$list = $this->getContext()->getModel(*'GetQstLst'*, *'Default'*
)->GetQstLst();



     $this->setAttribute(*'list'*,$list);

}

*View File*

*public* *function* executeHtml(AgaviRequestDataHolder $rd)

     {

     parent::setupHtml($rd);

     $this->setAttribute(*'qstlist'*,$this->getAttribute(*'list'*));



     }

Now my issue is..

I have a select box in which value is generated through DB. When the page
loads for the first time the select box is filled. When I press submit
button. The validation occurs and the error message comes at top. At this
time the select box gets Blank or the list gets empty. I have provided
validation only to a text box and not to this select box.

How can I retain the value after validation in select box?



Hope u all understand my issue..



Thax



surej
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to