Trigger javascript event when using Google auto fill on firefox

前端 未结 3 1682
失恋的感觉
失恋的感觉 2021-01-13 02:57

I have a form, in which I am disabling the submit button until an user has typed in all the mandatory fields. I was initially using onkeyup to keep a tab on the mandatory fi

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-13 03:21

    Thanks for your answers. I had to respond quickly to this issue hence I used the 'setTimeOut()' function to check for mandatory fields and enable the submit button.

    $().ready(function() {
        CheckRequiredFields();
        timeOutRtn = setTimeout("AutoMonitorMandatoryField()", "3000");
    });
    
    function AutoMonitorMandatoryField() {
        if ($("#btnSave").attr("disabled")) {
            CheckRequiredFields();
            timeOutRtn = setTimeout("AutoMonitorMandatoryField()", "3000");
        }
    }
    

    crescentfresh - I will look into the DOMAttrModified event and see if I can get it to work for me.Thanks

提交回复
热议问题