Forums

problem using Validation in a Dynamic Form

mapme 13 Jul, 2010
Hi,
I am using the Dynamic Forms code, as outlined in the ChroneEngine FAQ (Question #47).
I have got it working perfectly, except for one potential bug.

One of my dynamic options opens an additional form dropdown, and there is validation on this new field. the problem is that there are 3 other options hidden that share the same ID and Name tag. ChronoForms validation will not allow me to proceed with submitting the form because the invisible fields all need to be validated.

Is there a way around this? Wrecking my head, and took ages to even find out what the problem was!

All help greatly appreciated.

thanks a lot,

Brendan
GreyHead 14 Jul, 2010
Hi Brendan,

Tricky. One option is to avoid the duplicate names if you can.

I have solved this in the past by using a script to remove the validation classes from the hidden inputs. It's not elegant but it does work.

Bob
mapme 14 Jul, 2010
Hi Bob,
Thanks, as ever, for your suggestion.
I've tried researching where to go about removing validation from hidden fields... do you have an example on this?
Thanks,
Brendan
GreyHead 14 Jul, 2010
Hi Brenda,

A script to remove them is fairly easy. In pseudo code - find all inputs with display:none, and remove class:required

It's a bit tricker putting them back if you later re-display the input. I guess I might replace them with class:x-required so that it's easy to reverse.

Bob
This topic is locked and no more replies can be posted.