How to disable a button on a multi row form

I have a multi row form and each row has a button called “Create Defect” and a drop down box called Status with some values.

If I select Fail status for a row then I should be able to disable “Create Defect” button only for that row.

I have written code to disable button but it is disabling button for all the rows of that multi row form.

Quick help is much appreciated

Thanks.