contact.js 548 B

12345678910111213141516171819
  1. function validate() {
  2. var valid = true;
  3. if($('#senderNameBox')[0].checkValidity() && $('#senderEmailBox')[0].checkValidity() && $('#messageBox')[0].checkValidity()) {
  4. $('#submitButton').prop('disabled', false);
  5. } else {
  6. $('#submitButton').prop('disabled', true);
  7. }
  8. }
  9. $(function() {
  10. var form = $('#theContactForm');
  11. H5F.setup([form[0]], {
  12. validClass: 'valid',
  13. invalidClass: 'invalid',
  14. requiredClass: 'required'
  15. });
  16. $.each([$('#senderNameBox'), $('#senderEmailBox'), $('#messageBox')], function(i,o) { $(o).keyup(validate) });
  17. });