Forums

Forms Validation Messages not displaying correctly in table

hjelliott 20 Mar, 2011
Hi

I have a form (http://www.ynswinsurance.com/content/component/chronocontact/?chronoformname=autocover01) which has two sets of radio buttons to select various options.

The form was created with the wizard.

When validation occurs, the first set of radio buttons works as expected - if the validation message appears it appears beside the group label.

The second set set do not work as expected - if the validation message appears, it is repeated for every element.

The only difference between the two sets of radio buttons is that I have formatted the second set into a 3 column table instead of a single column list.

I would really like to have only the one message appear. What have I done wrong ?

Thanks
GreyHead 20 Mar, 2011
Hi hjelliot,

I'm afraid that this is a side-effect of the way that validate-one-required is set up. In effect the code looks for the parent tag for the validated input and checks to see what other inputs share the same parent. Once you separate the radio buttons into separate <td> tags none of them share any parent and so they are all validated individually and all fail the validation.

I know that's not very helpful to you but it does explain the reason why it's happening.

I tmay be possible to create a custom validation that will get round this. I'll try to find time later to experiment a little.

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