Trying to check the value directly using the form field's name is not a valid practice. The valid method is using g_form.getValue('<name_of_the_field'>).
In order to check the value of a field in a form, use the following:
if(g_form.getValue('<name_of_the_field>' == ""))
if('<name_of _the_field>' == "")