开发者

form.onsumbit subclass

开发者 https://www.devze.com 2023-02-12 09:51 出处:网络
i write smart extension for chrome and I inject my javascript inside all frame in frameset page... In one of frame I want to replace onsumbit for form.

i write smart extension for chrome and I inject my javascript inside all frame in frameset page...

In one of frame I want to replace onsumbit for form. I want to analyze (x, y) values for image type field before make submit.

I can find element by name开发者_运维知识库 to get form. I can get onsubmit property. But how to make check sending values before submit?

Thanks.


Hm, something like this?

var formEl = document.getElementById("form1");

var originalOnSubmit = formEl.onsubmit;

formEl.onsubmit = function() {
    if(all_ok) {
        originalOnSubmit();
    } else {
        return false;
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消