form validation using javascript in changing input tags
===

I need to validate a form using javascript.The form keep changes since I am using data from a field name table to print each fields like name,address,phone no.
I'm using a loop to print the label for field and corresponding text input tag.
(eg.name : textbox to enter name
    phone no : textbox to enter phone no. )
And at last getting these values in an array when submitting the form and entering into details table
Following is the code for printing each fields and text box...

    

while ($row=mysql_fetch_array($result)){
                            echo'<labelfor='.$row['field_name'].'name=field_id>'.$row['field_name'].':</label>';
                            
echo'<inputtype="text" name=field_name[]id="'.$row['field_id'].'":value="'.$row['field_value'].'" size="20" class = "inpBox" >';
     }
Now I Need to check whether these fields are empty using javascript and then change style of that particular text box...

Any help will greatly appreciated...
Thank you guys..