|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
gestionti Smarty Rookie
Joined: 02 Mar 2005 Posts: 15 Location: Gatineau, Qc, Canada
|
Posted: Fri Mar 11, 2005 2:05 am Post subject: Post-Validation of html_radios |
|
|
I am using the following in a form :
{html_radios name="sexe" values=$sexe_id
output=$list_sexe separator="<br />" selected="2" }
When the form is validated, the form return desired error message to advise the user and also contain pre-entered information through someting like
value="{$grandeur|escape}"
in the case of an input text box.
Now every time the form is regenerated, the html_radio returned unchecked. I can't figure out how to do this.
Regards, Mario |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 11, 2005 2:53 pm Post subject: |
|
|
Viewing your HTML source of the redrawn form, is there a radio button marked as checked? This will determine if the problem is in the code or possibly a browser cache thing. Be sure you always shift-reload forms during development of their templates. |
|
Back to top |
|
gestionti Smarty Rookie
Joined: 02 Mar 2005 Posts: 15 Location: Gatineau, Qc, Canada
|
Posted: Sat Mar 12, 2005 2:49 pm Post subject: |
|
|
Problem solvec
AddPersonValidate.php:
$smarty->assign('sexe_id',array(0,1));
$smarty->assign('list_sexe',array('Homme','Femme'));
$smarty->assign('sexe','2');
sexe=2 give a non selected value when the form first load.
AddPersonForm.tpl:
{html_radios name="sexe" values=$sexe_id
output=$list_sexe selected="$sexe" separator="<br />" }
Was missing selected="$sexe". Doh!! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|