Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Post-Validation of html_radios

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
gestionti
Smarty Rookie


Joined: 02 Mar 2005
Posts: 15
Location: Gatineau, Qc, Canada

PostPosted: Fri Mar 11, 2005 2:05 am    Post subject: Post-Validation of html_radios Reply with quote

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
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Mar 11, 2005 2:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
gestionti
Smarty Rookie


Joined: 02 Mar 2005
Posts: 15
Location: Gatineau, Qc, Canada

PostPosted: Sat Mar 12, 2005 2:49 pm    Post subject: Reply with quote

Problem solvec Smile

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP