Using xajax in a module
Posted: Mon Jun 30, 2008 1:45 pm
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 !
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 !