1 / * * 2 * binding event to the input box . 3 * * @param {} the fieldId field input box ID . 4 * * @param {Event} eventFn check function . 5 * / . 6 function bindCheckEventOnInput (the fieldId, eventFn) { . 7 var oldCheckinput2 window.checkinput2 =; // store original check function . 8 window.checkinput2 = function (EID, eSpanId, viewType) { . 9 iF (EID == the fieldId) { // when the field id is the specified id, perform a custom event 10 eventFn ( ); . 11 } 12 is return oldCheckinput2 (EID, eSpanId, viewType);// implementation of the original check function 13 }; 14 }
Means ecology8 native check function, performing a custom operation after the value of the input box is changed. Call example:
bindCheckEventOnInput ( "field12345", function () { Alert ( "value change!" ); });