davnicwil
davnicwil

Reputation: 30967

Tapestry 5 - How can I do client-side 'required' validation on <t:radiogroup>?

I need to validate, on the client, whether one of the radio buttons in a <t:radioGroup> has been selected on form submission.

Using the standard t:validate="required" attribute like so does not work

<t:radiogroup t:id="options" value="data.options" t:validate="required" >
    <t:label for="option1"/><t:radio t:id="option1" t:value="option1"/>
    <t:label for="option2"/><t:radio t:id="option2" t:value="option2"/>
</t:radiogroup>

N.B. it is possible to do this server-side using the standard validate="required" attribute - but again I need this client-side.

It seems odd that the standard server-side required validation works but the standard client-side required validation doesn't work for the <t:radiogroup> component.

How else can I achieve this on the client-side?

Upvotes: 1

Views: 529

Answers (1)

Howard M. Lewis Ship
Howard M. Lewis Ship

Reputation: 2337

Currently, this is something you have to implement yourself. If there is not already an issue about this, you should feel free to add one to Tapestry's JIRA.

Upvotes: 1

Related Questions