Thanks man!! All it needed was the onComplete funtion to fire up validator.
On 2 maalis, 10:01, Thierry bela nanga <[email protected]> wrote: > you just can use the onComplete to manually attach the validator to your > form, > there should be a method in your validator, > you could do something like this. > > //I remove the selector to avoid attaching the same validator many times > $$('form.loaded'). > removeClass('loaded'). > each(function (form) { > > //linking manually here, you would probabily need to adapt this to your > validator > document.formvalidator.attachToForm(form) > > > > }); > On Sat, Feb 28, 2009 at 6:26 PM, Roope <[email protected]> wrote: > > > Thanks for reply guys! > > > @Thierry > > I already tried to include both validator and mootools to loaded form > > but that didn't help.. So it seems that problem lies in the fact that > > there is no domready event in ajax load like electronbender just > > taught us. > > > @electronbender > > I still at beginner level with all world of javascript and mootools so > > I'm trying to learn from demos and modify them for my needs. Combining > > my previous script and mootools Json.Remote demo I got something like > > this but sure it doensn't work: > > window.addEvent('domready', function(){ > > var addForm = function(e) { > > var url = "tarjous.html"; > > new Ajax(url, { > > method: 'get', > > onComplete: handleMyAjax.bind(this), > > update: $('valmis') > > }) > > .request(); > > } > > > $('hae').addEvent('click', function(e) { > > e = new Event(e).stop(); > > var url = 'js/validate.js'; > > var request = new Json.Remote(url, { > > onComplete: function(jsonObj) { > > addForm(jsonObj.previews); > > } > > }).send(); > > }); > > }); > > > I have no idea how to combine these two in two into working script. > > Can you help a bit m8? > > > On 25 helmi, 18:58, Thierry bela nanga <[email protected]> wrote: > > > you must attach the validator to the loaded form > > > > On Wed, Feb 25, 2009 at 5:56 PM, electronbender > > > <[email protected]>wrote: > > > > > There is no domready event on the ajax load, the page is already > > > > loaded. > > > > Re-think your logic, and try to use json instead. > > > > > On Feb 22, 12:45 pm, Roope <[email protected]> wrote: > > > > > Hi everyone! > > > > > > I have sitetemplate where I use mootools AJAX call on contact page to > > > > > switch between two different contact forms (contact and offer). Form > > > > > uses phatfusion sites v1.11 validate script and it works fine with > > > > > default one but not with one imported via AJAX. > > > > > > AJAX function is similar to described in v1.11 demopage: > > > > > window.addEvent('domready', function(){ > > > > > $('hae').addEvent('click', function(e) { > > > > > e = new Event(e).stop(); > > > > > > var url = "tarjous.html"; > > > > > > new Ajax(url, { > > > > > method: 'get', > > > > > update: $('valmis') > > > > > }) > > > > > .request(); > > > > > }); > > > > > > }); > > > > > > Check out page in function:http://testi.blowback.fi/yhteys.html > > > > > > How could I get validator to work in this "tarjous.html" form also? > > > > > Should I add some onComplete function to call validator or why isn't > > > > > it included in the first place since css is affected to form > > elements? > > > > > Any help is much appreciated! > > > > -- > > > fax : (+33) 08 26 51 94 51 > > -- > fax : (+33) 08 26 51 94 51
