final cleanup

-simplified if/else statement
-error message displays correctly
-reinserted form tags in html and used preventDefault in query on
submission: this removed the need to look for the keystroke 13