|
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 |
schoenung Smarty Rookie
Joined: 05 Apr 2004 Posts: 28
|
Posted: Tue Mar 08, 2005 3:26 am Post subject: Compare rule |
|
|
I have 3 fields-2 edits and 1 drop down. Trying to validate the drop down in the following maner. If drop down value = 16 then edit box need not be filled in, however if the drop down value is not 16 both edit boxes are required and must be validated. The validation is easy, but having trouble writting the compare function as I'm unsure where to get the values of the other controls.
My function would work like this.
Code: | function smarty_validate_criteria_isEditValueRequired($value, $empty, &$params, &$formvars) {
if(strlen($value) == 0)
return $empty;
if ($_POST[list]!=16){
return=TRUE;
}
} |
However something does not work.
[/code] |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Mar 08, 2005 2:39 pm Post subject: |
|
|
You can use $formvars instead of $_POST, but what does this produce?
print_r($formvars);
Be sure your values are what you expected. |
|
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
|