I have 1 checkbox and 2 date fields. I need the date fields to be required only if the checkbox is checked. It doesn’t seem to be possible “out of the box”, assuming that is correct, can anyone point me in the right direction how to handle this? Or maybe there is a solution already out that I couldn’t find? I considered a hook on publish page to add the validation, but I think I would need to make these all custom fields in order to properly identify them. Or could I do custom checkbox and date fields with the javascript added and skip the hook? (But that would be client side validation which is useless.) Not familiar enough with EE to know what is the best direction to go here.
I put the same question to my EE meetup peeps after no one responded to my similar question here http://ellislab.com/forums/viewthread/194025/ and have had some other ideas of my own since:
(some don’t actually validate, but they allow for determining within the template which date field to be used)
Use this plugin to hide the date field you don’t want to be completed depending on whether checkbox is checked or not http://devot-ee.com/search/tags/tag/show_hide_fields/
why would client side validation be useless?
None of these are perfect. I’m still looking - would love to hear if anyone else has solved this. I wish I knew how to make an accessory to do the jquery validation - maybe time to learn…
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.