Should try to use jQuery validate for this