Welcome Guest, Not a member yet? Register   Sign In
Coding Approach Question - (Validation?)

Hello all,

I'm currently trying to figure out how to do something but I have no idea how.

Here is what I am trying to do. I have a form where you can dynamically add groups of form fields via jQuery. Like this:

-- Before (img)

-- After (img)

So you don't add just one input, you add a group.

Now here is my question:

While actually filling out one of the field groups is optional, if you choose to use one, you must fill out all fields in that group.

How can I check for this? I currently have all the inputs in a field group set to arrays. I was thinking of maybe doing a count() of all the input arrays and then finding out the max() to see how many groups were actually added or something like that. How would I find out that the person only filled half of one of the groups or something? I don't want people only partially filling out neither would I like to have tampered forms being passed over.

Im guessing validation would be kinda hard for this as well?

Thanks in advance for your help. I really need assistance with this.


Theme © iAndrew 2016 - Forum software by © MyBB