Form Request :: Validation Date of Birth Select Dropdowns
I have a form with 3 drop down menus Day (Ranging From 1 - 31) | Month (Ranging From 1 - 12 e.g Jan = 1) | Year (ranging from 2016 - 1905) how can a validate it to be a valid date of birth using form requests?
well.. you can set min and max.. and .. kinda.. that.s all you need everyday is a birthday .. except that .. if the month is february .. you need the day to be no more than 29 but in some cases no more than 28 . so.. why not use a date field in the form..
As @donkfather hints, your question is a bit on the vague side. I think what you might be asking is "how can I validate that it is a valid date?" in general terms. In other words, you are using three inputs and you need to make sure the combination of the three forms a valid date. Is that correct?
Assuming it is, you can use the min, max rules and the like to make sure the values submitted are reasonable but then I think you need to run another test on all three fields.
Personally I wonder if you can use the after() method available on Validator objects to chain validations inside a FormRequest class. Does anyone know if this is possible?