validate form inputs on the back end