Posted By

buda9 on 05/24/14


Tagged

javascript words submit contact


Versions (?)

Prevent users submitting contact form if less than 2 words are entered (JavaScript)


 / Published in: CSS
 

Prevent users submitting contact form if less than 2 words are entered (JavaScript)

  1. $('#question_submit').click(function (e) {
  2. e.preventDefault();
  3.  
  4. if ($('#question_name').val().toString().split(' ').length > 2) {
  5. $('#new_question').submit();
  6. }
  7. });

Report this snippet  

You need to login to post a comment.