Simplifying onsubmit conditional