How To Capture Form's Fields Focus Lost Event In Prototypejs
I have a simple form like this:
Solution 1:
Add id='SelectBox'
to your select box and id='Textbox'
to your text box and try the following:
function handleTextBoxBlur(event, element) {
console.log("blur");
console.log(element);
}
function handleSelectBoxChange(event, element) {
console.log("change");
console.log(element);
}
document.observe("dom:loaded", function(event) {
$("Textbox").on("blur", "input", handleTextBoxBlur);
$("SelectBox").on("change", "select", handleSelectBoxChange);
});
Solution 2:
$('input').focus_lost(function() { /write what Ever code need/ });
$('option').change(function() { /write what Ever code need/ });
/This is suitable only for this given form..Learn more from a link >and http://jqueryui.com//
Post a Comment for "How To Capture Form's Fields Focus Lost Event In Prototypejs"