This javascript checks to see if the field has any data in it

Name:

For future reference, you'll still want to validate data before inserting records or updating records in a database