[SOLVED] How to validate form using button [V2]

Hi @nolimits4web,

I want to validate form using button event, how I can achieve that on V2.

If I understand you correctly, you want to validate input fields when you click submit rather than on keypress / change?

1 Like

Thx, I was not aware of the new Input functionality / validation. A very nice extension to Framework 7 ! :slight_smile:

Sorry for the late response, I already solved the how to validate it using code below

  $$('.save').on('click', function(e){
      e.preventDefault();
      if (!$$('#form-name')[0].checkValidity()) {

        console.log('Check Validity!');

      } else {

        //ajax request here
        return false;

      }

});
2 Likes