Radio button determines which text fields in table are required
I have a radio button named group6. There are 3 options to choose from directorder, POR, buildandreplace.
Depending on which option you choose determines which columns of the table need to be filled out. If you select directorder or POR, then if you fill out an item code and you must enter the quantity in that row of the table. If you select billandreplace and all the columns in the order form are required. Below is an image of the order form.

The 1st row the item code name is itemcode1.0. So the action for that field is set to mouse up and run JavaScript. Here is the script that I wrote:
if (event.value.length>0 && getField("group6").value == "directorder") {
this.getField("qty1.0").required = true;
}
I would repeat this code for each item code row. But it's not working. What am I doing wrong? I have it set so that the form validates prior to being submitted. It alerts the user of any required fields that are not filled in. If I enter an item code none of the required fields are mentioned in the alert.
