Railo.Ajax.ajaxForm

The function prepare the form to be submitted via ajax when the submit event is fired!

window.onload = function(){
Railo.Ajax.ajaxForm('ajaxForm','messageBox');
}




Tip

You can provide to ajaxForm a callbackHandler to intercept the data but you can also listen to event Railo.AfterInnerHtml that is dispatched any time a bunch of html is injected by any library method.

Event will carry the id of the element where html has been inserted as lonely argument.

function highlight(id){
if (id == 'messageBox2') {
var el = document.getElementById(id);
var actualBG = el.style.backgroundColor;
el.style.backgroundColor = 'yellow';
setTimeout(function(){
el.style.backgroundColor = actualBG;
}, 1000);
}
}
Railo.Events.subscribe(highlight,'Railo.AfterInnerHtml');
window.onload = function(){
Railo.Ajax.ajaxForm('ajaxForm2','messageBox2');
}