how to get value from a text field and store it as a global variable for later validation with the database?