如何在以下情况下禁用输入类型=文本

I've got the following table which is build for every guest entry in a MySQL table.

    echo '<tr>
            <td>'.$gastId[$i]." ".$voornaam[$i].'</td>
            <td><input type="radio" name=present'.$gastId[$i].'[] value=1 onclick="setReadOnly(this)" checked></td>
            <td><input type="radio" name=present'.$gastId[$i].'[] value=2 onclick="setReadOnly(this)"></td>
            <td><input type="text"  name="artiest[]" value="'.$artiest[$i].'"></td>
            <td><input type="text"  name="titel[]" value="'.$titel[$i].'"></td>
        </tr>';

I would like to disable the two fields artiest (artist) and titel (title) base on the radio button present'.$gastId[$i].

I was trying to solve it with javascript, but I have little experience with javascript. Is there a way link the radio buttons and text field per row by ID or something?

<script language='javascript'>
<!-- //
function setReadOnly(obj)
{
    if(obj.value == 1)
    {
        document.forms[0].artiest.readOnly = 0;
    } else {
        document.forms[0].artiest.readOnly = 1;
    }
}
// -->
</script>

Thank you very much for your help!

EDIT 21-10-2012

Sorry I've should have been more clear.

If the table looks like this:

------------------------------------------------
|  P  |  NP  | Artist        | Title           |
------------------------------------------------
|  X  |      | Enabled       | Enabled         |
------------------------------------------------
|     |  X   | Disabled      | Disabled        |
------------------------------------------------
etc

So the radio button of that row controls if the fields in that same row are enabled or disabled.

just add ID to :

<td><input type="text"  id="artiest" name="artiest[]" value="'.$artiest[$i].'"></td>
                        ^^^^^^^^^^^

I've got it working:

I've added the ID fields to the elements.

    echo '<tr>
            <td>'.$gastId[$i]." ".$voornaam[$i].'</td>
            <td><input type="radio" id='.$gastId[$i].' name=present'.$gastId[$i].'[] value=1 onclick="setReadOnly(this)" checked></td>
            <td><input type="radio" id='.$gastId[$i].' name=present'.$gastId[$i].'[] value=2 onclick="setReadOnly(this)"></td>
            <td><input type="text"  id=artiest'.$gastId[$i].' name="artiest[]" value="'.$artiest[$i].'"></td>
            <td><input type="text"  id=titel'.$gastId[$i].'   name="titel[]" value="'.$titel[$i].'"></td>
        </tr>';

and changed the javascript:

function setReadOnly(obj)
{
    if(obj.value == 1)
    {
        document.getElementById("artiest"+obj.id).readOnly = 0;
        document.getElementById("titel"+obj.id).readOnly = 0;
    } else {
        document.getElementById("artiest"+obj.id).readOnly = 1;
        document.getElementById("titel"+obj.id).readOnly = 1;
    }
}
// -->
</script>

Thank you all for your help!