seltzer icon indicating copy to clipboard operation
seltzer copied to clipboard

Validate dates on input

Open myself248 opened this issue 12 years ago • 2 comments

I just noticed this when using the "filter: active members" function on the members page, and there was a member in the list but his "membership" column was blank.

I checked his record, and he had a dues plan with normal start-date and end-date, and a "leave" plan with a 0000-0-0 start date and no end. This apparently confuses some things!

The add-plan form should check dates for validity before accepting Save.

myself248 avatar Jan 29 '14 22:01 myself248

We can do this by adding the jquery validate plugin: http://jqueryvalidation.org/

Then we can find fields with the "date" class and set their validation rule accordingly.

elplatt avatar Jan 30 '14 01:01 elplatt

Note that client-side stuff like this can be broken by such things as "putting the server instance behind SSL", whereupon a whiny browser decides to just ignore all the scripts in the page, a la #336. It would be more robust to make the server side actually confirm that the date is somewhat valid (at least, doesn't cause #228) before saving it.

myself248 avatar Sep 25 '14 14:09 myself248