Hi PHP coders,
I've got an issue I'm stuck with. Imagine there is a large form that has 5 columns and 20 rows.
In each row there is a check box - then 4 input fields. I already have the code that inserts all
the data BUT the validation is a nightmare.
What I need is. If an entire row is empty (not checked or filled out) that's OK. However if a user
fills in one or two input fields within a row - that's NOT ok. The entire row needs to be filled
out. It's an all or nothing situation.
Lets say each column is called a, b, c, d, e
I started writting various if statements but it instanly becomes out of control.
example if a but not b and a and b and not c etc.... each row has many combinations.
How can i structure php code that looks at each row and determines if the row is partically filled
out, then valdiation fails . Validation passes if the row is complely empty or completely full.
Heres the kicker, the input fields in this form do not have a consistant naming pattern all the
fields have unique identifier. Also one column expect a date another an integer another text.
Thanks for your help
I've got an issue I'm stuck with. Imagine there is a large form that has 5 columns and 20 rows.
In each row there is a check box - then 4 input fields. I already have the code that inserts all
the data BUT the validation is a nightmare.
What I need is. If an entire row is empty (not checked or filled out) that's OK. However if a user
fills in one or two input fields within a row - that's NOT ok. The entire row needs to be filled
out. It's an all or nothing situation.
Lets say each column is called a, b, c, d, e
I started writting various if statements but it instanly becomes out of control.
example if a but not b and a and b and not c etc.... each row has many combinations.
How can i structure php code that looks at each row and determines if the row is partically filled
out, then valdiation fails . Validation passes if the row is complely empty or completely full.
Heres the kicker, the input fields in this form do not have a consistant naming pattern all the
fields have unique identifier. Also one column expect a date another an integer another text.
Thanks for your help
Comment