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

SmartyV'date, radio button in one form, different checks..

 
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
elyobelyob
Smarty Rookie


Joined: 17 Sep 2007
Posts: 5

PostPosted: Wed Oct 03, 2007 10:52 am    Post subject: SmartyV'date, radio button in one form, different checks.. Reply with quote

EDIT : Actually, I solved this. Basically I altered the if statement for smarty validate

if(SmartyValidate::is_valid($_POST) || $_POST['address_type']=="choice1")

------------------

Hi, I have a form which gives a choice between entering an address or choosing an existing address ...

The "enter address" needs notEmpty checks, however if the user checks an existing address I want those checks disabled.

I have the if (empty($_POST)) check which registers the validators, however if I use smarty to {if $radiobuttonchecked} {validate} {/if} within the template, it automatically falls through if(SmartyValidate::is_valid($_POST)) check and goes to "redraw the form".

As the $_POST is empty at the start, then the register_validator is always done.

So, I guess I want to do a "if user has chosen a stored address, ignore the validate" .. any ideas?

Thanks
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