Hi Bob,
I see there are posts about validation but I couldn't find one that went into maybe a basic question.
Let's say I want to get the value submitted from a form textbox and if the value doesn't equal something of my choice, have it bounce back. I just couldn't get a grasp on anything anyone submitted as questions in the forum.
Let's say a textbox fieldname is age and I want someone to only respond in a certain range for example over 64. My guess is that I would probably put the code in the block "Custom Code - Before Email(s)" something like this but how would I make it return with the validation error and not submit it until corrections are made.
Thanks for any help.
Mike
I see there are posts about validation but I couldn't find one that went into maybe a basic question.
Let's say I want to get the value submitted from a form textbox and if the value doesn't equal something of my choice, have it bounce back. I just couldn't get a grasp on anything anyone submitted as questions in the forum.
Let's say a textbox fieldname is age and I want someone to only respond in a certain range for example over 64. My guess is that I would probably put the code in the block "Custom Code - Before Email(s)" something like this but how would I make it return with the validation error and not submit it until corrections are made.
<?php
$valid = true;
$owner_age=JRequest::getString('age', '', 'post');
if ( $owner_age>64 ) {
$form->validation_errors['age'] = "I'm sorry you must be over 64 to submit this form.";
$valid = false;
}
return $valid;
?>
Thanks for any help.
Mike