Inserting form validation with javascript