• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Needed. How to have a required field validation on a field that only posts if another field is a certain value

#1
[eluser]Unknown[/eluser]
Hi

I have a form that unhides a field when a certain value is chosen in a select menu. If this value is chosen the field needs to be required.

However if I make the field required in the validation rules it won't submit the form if the value isn't chosen out of the select menu. How can I manipulate the validation rules so it will only set that field to be required if a certain value for another field is posted?

I tried this:
Code:
if($_POST['hearabout']=='The Investors Club') {
   $fields['supportMember']            = "required";
}else{
   $fields['supportMember']            = "callback_nothing";
}

But it doesn't set the field as 'Required' when the post value is set to 'The Investors Club'.

Any help would be greatly appreciated


Messages In This Thread
Help Needed. How to have a required field validation on a field that only posts if another field is a certain value - by El Forum - 10-14-2009, 09:48 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.