Guest User

Untitled

a guest
Feb 18th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. const vueApp = new Vue({
  2. el: '#validated-form',
  3. methods: {
  4. submitForm () {
  5. if (this.validateForm()) {
  6. console.log('formValidated');
  7. //submit form to backend
  8. }
  9. },
  10. validateForm () {
  11. var formId = 'validated-form';
  12. var nodes = document.querySelectorAll(`#${formId} :invalid`);
  13. console.log(nodes);
  14. return true;
  15. }
  16. }
  17. });
Add Comment
Please, Sign In to add comment