hi guys i have a bit of an issue i cant seem to tackle i need to validate the below code to make sure before a user updates each row from the table that's displayed. the data has not been deleted so its not empty or doesn't just contain white-spaces

how can i validate this using JavaScript to make sure the user hasn't deleted the data or hasn't just put white spaces in i will need to do this for about 20 results in the table so using a function would be awesome so no matter how many results are displayed each row is validated and can be update individually 

```
    $result2 = mysqli_query($con,"SELECT * FROM tbl_staffmembers");
    while($row2 = mysqli_fetch_array($result2))
        {       
            echo "<tr><td><input type='text' value=' " .  $row2['staffmember_firstname'] . " '></td><td><input type='submit' value='Update'></td></tr>";                                                

        }

```

thanks for your help in advance i know how to create function so far everything i have tried will only allow me to validate the first row that's displayed i need to be able to validate and submit each row buy its self like a shopping cart updating the quantity 1 buy 1

just to be clear i have created the below i need to validate each row separately to make sure there is no white spaces or its not empty

<http://jsfiddle.net/o7adxn7c/>