Has anyone managed to have different validation scenarios depending on one of the form fields?
For example, for a classified ads site, the ad can have 2 types : either "sell a car" or "search for a car"
from there, if the user is selling a car, horsepower and mileage need to be mandatory, whereas if the user has selected search, he doesn’t need to be so specific.
Do you think a better approach would be to have 1 form for each type or is there a way to do this in one single form?
When I needed something like that, I used different forms.
But once I saw a similar question here in the forum and IIRC, someone managed to use only one. Maybe you can find it. Let me check the forum too if I can find that post.
Thanks for the tips, however, the problem is there are no * beside the fields that are only required when the first field (a dropdown in my case) has a given value…
Mentel : have you found the post you were refering to?
When you were using different forms, how did you deal with validation rules? They are specified at Model level.