Hello I'm trying to use Xajax in a module I have maid, but it actually don't work. (I have started using xajax and progamming ms module very recently)
So, here is my code related to xajax in my action.default.php :
function validPostal($codepo){
if($this->isValidCodePostal($codepo) !== FALSE){
return 'Ville :'.$this->isValidCodePostal($codepo).'';
}else{
return '';
}
}
require_once('lib/xajax/xajax.inc.php');
$xajax = new xajax();
$xajax->registerFunction('validPostal');
$xajax->processRequests();
// ..............
// here I'm sending smarty tags....
$ajaxiser = 'onkeyup = "xajax_validPostal(codepostal);"';
$this->smarty->assign_by_ref('votrecodepostal', $this->Lang('votrecodepostal'));
$this->smarty->assign_by_ref('codepostal', $this->CreateInputText($id, 'codepostal', $codepostal, 30, 155, $ajaxiser));
[/sup]
But sadly this don't want to work and I get the following firebug message :
xajax_validPostal is not defined
I'm sure I'm missing something simple, but still can't figure what.....
Any advice are welcome !
Using xajax in a module
Using xajax in a module
Last edited by solaris23 on Mon Jun 30, 2008 1:47 pm, edited 1 time in total.
Re: Using xajax in a module
Have you tried to use Ajax made simple module?
It makes Xajax usable for CMSms ...
It makes Xajax usable for CMSms ...
Re: Using xajax in a module
I just install it, but I don't see any difference, I'm still getting the same error.
Can someone seen something wrong in my code ?
Thanks in advance..
Can someone seen something wrong in my code ?
Thanks in advance..
Re: Using xajax in a module
Ok I had, now, wrote this code :
No error message, but no action, and I don't find the way of using onkeyup
with Ajax made simple.....
so in my action.default.php
$ajax=$this->GetModuleInstance("AjaxMadeSimple");
$ajax->RegisterAjaxRequester($this->GetName(),"verifcp","localite","validPostal","validPostal.php",array(),array("codepostal"=>"clear"));
$this->smarty->assign_by_ref('votrecodepostal', $this->Lang('votrecodepostal'));
$this->smarty->assign_by_ref('codepostal', $this->CreateInputText($id, 'codepostal', $codepostal, 30, 155));
[/sup]
in my modulename.module.php
function validPostal($codepo){
if($this->isValidCodePostal($codepo) !== FALSE){
return 'Ville :'.$this->isValidCodePostal($codepo).'';
}else{
return 'rien';
}
}
and in my template :
{$votrecodepostal}*:
{$codepostal}
No error message, but no action, and I don't find the way of using onkeyup
with Ajax made simple.....
so in my action.default.php
$ajax=$this->GetModuleInstance("AjaxMadeSimple");
$ajax->RegisterAjaxRequester($this->GetName(),"verifcp","localite","validPostal","validPostal.php",array(),array("codepostal"=>"clear"));
$this->smarty->assign_by_ref('votrecodepostal', $this->Lang('votrecodepostal'));
$this->smarty->assign_by_ref('codepostal', $this->CreateInputText($id, 'codepostal', $codepostal, 30, 155));
[/sup]
in my modulename.module.php
function validPostal($codepo){
if($this->isValidCodePostal($codepo) !== FALSE){
return 'Ville :'.$this->isValidCodePostal($codepo).'';
}else{
return 'rien';
}
}
and in my template :
{$votrecodepostal}*:
{$codepostal}
Last edited by solaris23 on Mon Jun 30, 2008 3:10 pm, edited 1 time in total.
Re: Using xajax in a module
Have you tried to use Firefox / Firebug plugin to check it?