Cleanest, least hideous way to do dropdown date validation?

My customer has dropdowns like this:

Year Month Day

If you submit with month selected and year blank, it subs in a year
arbitrarily. Worse still, it subs in the year 5. I have no idea why.
It seems a pernicious default.

Anyway, they’re developing an app, they’re a designer turned coder,
turning to a real programmer (me, allegedly) to make sense of the
madness they’ve created.

Obviously I could write something in JavaScript to handle it. What I
want to know is, what is the most elegant way to do this? What is the
least clunky way? Does something like this exist already? I’ve been
googling and found little but it seems something should and would. All
I want to do is say “you can’t hit submit if you’ve selected only one
of the three dropdowns. Either you select all three, or none.”

Giles B. wrote:

Obviously I could write something in JavaScript to handle it. What I
want to know is, what is the most elegant way to do this? What is the
least clunky way? Does something like this exist already? I’ve been
googling and found little but it seems something should and would. All
I want to do is say “you can’t hit submit if you’ve selected only one
of the three dropdowns. Either you select all three, or none.”

I use a javascript popup calendar instead of the ugly triple dropdown
method for dates. I use this one:

http://www.dynarch.com/projects/calendar/

-Tom

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs