I'm currently stuck on what at first appeared to be a pretty straight forward problem.

I have an input form that captures a profile of a member (it's for a flying club)
On the form are check boxes where the member can indicate the types of license held and also textboxes for the the expiry date of these licenses or ratings.

I want to check that if a checkbox has been selected a date has been entered into the appropriate textbox.

I have a regular expression that validates the data entered into the Textbox, but no way of testing if it's been left empty.I don't wan't to make it a required field because it's only required if the associated checkbox has been selected.

In summary how do I test a textbox control for data based on the selection of a checkbox.

Hope this makes sense