exactly.. create a fiddle and it'll be solved sooner than later :)
On Nov 26, 8:12 pm, אריה גלזר <[email protected]> wrote: > please use jsfiddle. mail is hardly a good place for us to read and debug > your code > > > > > > On Fri, Nov 26, 2010 at 8:22 PM, machadoug <[email protected]> wrote: > > @Oskar, > > That's what I had done since the beginning. I just posted that code as > > an example. > > I've tried the code below but it does not work: > > this.setHandler('sicaptcha', > > function (value) { > > var result; > > var url = 'plugins/content/captcha_systems/securImage2/ > > securimage_json.php'; > > var jSonRequest = new Json.Remote(url, {onComplete: > > function(response){ > > if(response.action == 'success'){ > > return true; > > }else{ > > return false; > > } > > } > > }).send(Json.toString({'captcha_code':value})); > > } > > ); > > > @Andrea, > > Yes, the JSON is valid. The same code works in this script: > > > window.addEvent('domready', function(){ > > $('captcha_code').addEvent('blur', function(e) { > > var url = 'http://localhost/joomla/1.5.12/plugins/content/ > > captcha_systems/securImage2/securimage_json.php'; > > var log_res = 'si_captcha_log_res'; > > $(log_res).addClass('ajax-loading'); > > $(log_res).setStyle('display', 'block'); > > $(log_res).setHTML('Cheking...'); > > > var jSonRequest = new Json.Remote(url, {onComplete: > > function(response){ > > //did it return as good, or bad? > > if(response.action == 'success'){ > > //email is already in use > > > $('captcha_code').removeClass('invalid'); > > > $('captcha_code').addClass('success'); > > $(log_res).setHTML('Code is > > correct'); > > }else{ > > > $('captcha_code').removeClass('success'); > > > $('captcha_code').addClass('invalid'); > > $(log_res).setHTML('Wrong validation > > code'); > > } > > $(log_res).removeClass('ajax-loading'); > > } > > > }).send(Json.toString({'captcha_code':$('captcha_code').value})); > > }); > > > }); > > -- > Arieh Glazer > אריה גלזר > 052-5348-561 > 5561
