Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const vueApp = new Vue({
- el: '#validated-form',
- methods: {
- submitForm () {
- if (this.validateForm()) {
- console.log('formValidated');
- //submit form to backend
- }
- },
- validateForm () {
- var formId = 'validated-form';
- var nodes = document.querySelectorAll(`#${formId} :invalid`);
- console.log(nodes);
- return true;
- }
- }
- });
Add Comment
Please, Sign In to add comment