J
J
Jojo11222018-09-20 11:05:32
JavaScript
Jojo1122, 2018-09-20 11:05:32

Is it possible to interrupt submit outside of the form?

There is a script:

function Validation() {
    if (document.getElementById('').checked && document.getElementById('').click) {
    event.preventDefault();
    grecaptcha.execute();
     if(grecaptcha.getResponse().length != 0){
          document.getElementById('').submit();
     }else{
        return false;
     }
    }
  }

Which performs a check-box check and a button click, but each command call via the console: Submits the form, is it possible to somehow interrupt such calls?
document.QuerySelector('#').submit;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2018-09-20
@Jojo1122

To intercept, see the third parameter in addEventListener()
https://learn.javascript.ru/event-bubbling
Or you can override the submit() method of the form.
But in general, I think you are doing something strange.

R
RidgeA, 2018-09-20
@RidgeA

form.on('submit', ...)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question