javascript - easyui textbox binding onchange event cannot get the latest text box value
怪我咯
怪我咯 2017-07-05 10:42:53
0
1
1485
<input id="id1" class="easyui-textbox" onchange="fun()">
function fun() {
    alert($("#id1").textbox("getText"));
}

The input value is not obtained after the input value in the input box loses focus

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
迷茫

The change monitoring event of

EasyUI is not written directly in the onchange event of input. The onclick event of input only monitors the operation of HTML itself, which may not be effective for EasyUI binding. The correct approach is to When binding the EasyUI control, write it in the control configuration:

$('#id1').textbox({  
    onChange: function(value) {
        alert($("#id1").textbox("getValue"));
    }
});
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template