Hi I´m having trouble while using Element.replace to handle changes made to an input element. Here´s what i´m doing:
I´m using $(' element').onblur = function() { } on a form to validate the field when the user tabs out or clicks on the next field, the validation is made on the php side and returns the code of the same input field plus some classes and a message of wheter the validation was ok or not. It looks something like this $('element').onblur = function() { pars = 'action=validate'; new Ajax.Request('file.php', { parameters: pars, method: 'post', onComplete: function(newcode) { $('element').replace(newcode.responseText); } }); } This works fine the first time. But when i put the focus back into the field and the out again it does nothing. Looks like the problem is that when the element gets replaced even by one with the same name, id, etc. prototype doesn´t recognize it anymore and doesn´t execute the onBlur function. Is there a way around this or another approach i could take? I know i could do the changes using setStyle, etc. but i have a php session instance of a class where i store all the properties so i can access them on other pages, because of this i want php to handle the proccessing and use prototype just to apply the changes. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---