I usually stick to the method of setting an error condition and an error message... Check your various requirements, setting error => 1 if any of them fail, and setting error_msg => "Date2 is a required field" or whatever the specific error is.
An alternate to this is to instead of setting error_msg, set things like error_date2badformat or such, which allows you to have all relevant error messages show at the same time (say, if they have multiple things wrong) so they can fix them all at once, and allows the actual text of the error messages to be modified by the html designer. the logic is simple, you don't have to do a lot of if else's nested, just check for error, then have a separate if/else for each potential error_* within the if error portion. - jody biggs --- Gregory Stark <[EMAIL PROTECTED]> wrote: > > How do I have multiple form constraints that affect the same columns > but have > different error messages? > > Specifically, I have two date fields, both fields are required, both > must be > in the correct format, and the second must be a later date than the > first. > Ideally I would want three separate messages > > "Date2 is a required field" > "Date2 must be in format xxx" > "Date2 must be later than Date1" > > And only the single message that's appropriate should appear, not all > of them. > > -- > Gregory Stark > Ideas And Associates > T +1 514 940 2891 x111 > H +1 514 486 9705 > C +1 514 945 3796 > F +1 209 828 3730 > http://www.ideasandassociates.com > [EMAIL PROTECTED] > [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
