Hi everybody,
I work on the upgrade of my fabrik apps.
Since i upgrade fabrik i have lot of problems and waste lot of time to re create that i created before :/
Now my problem is on the ajax function that change an image element when i select a data in a cascading dropdown. May be that some will remember this problem on fabrik 2.0
At one time, Felixkat sent me a pm to me his post about this feature and upgrade of fabrik:
http://fabrikar.com/forums/index.ph...-a-image-folder-path.23061/page-2#post-126135
Unfortunately after several hours of research, I still can not operate a tiny script. For a long time I have not touched Javascript and PHP so please excuse my ignorance as my knowledge is slightly faded
In my user_ajax, i have:
In the javascript of my cascading element :
I placed
after
to see if the correct data was sent well to the php script. ==> It's ok
But when i replace
by
i haven't the name of the image but this:
Somebody can say me what is wrong?
I work on the upgrade of my fabrik apps.
Since i upgrade fabrik i have lot of problems and waste lot of time to re create that i created before :/
Now my problem is on the ajax function that change an image element when i select a data in a cascading dropdown. May be that some will remember this problem on fabrik 2.0
At one time, Felixkat sent me a pm to me his post about this feature and upgrade of fabrik:
http://fabrikar.com/forums/index.ph...-a-image-folder-path.23061/page-2#post-126135
Unfortunately after several hours of research, I still can not operate a tiny script. For a long time I have not touched Javascript and PHP so please excuse my ignorance as my knowledge is slightly faded
In my user_ajax, i have:
Code:
function imgclasse() {
$db =& JFactory::getDBO();
$IdClasse = JRequest::getVar('classeid','');
$query = "SELECT icone_classe FROM fw_classes WHERE id='$IdClasse' LIMIT 1";
$db->setQuery($query);
$result = $db->loadResult();
echo $result;
}
In the javascript of my cascading element :
Code:
var url='index.php?option=com_fabrik&format=raw&controller=plugin&c=plugin&task=userAjax&method=imgclasse';
var classeid= $('fw_persos___classe').get('value');
var update = $('fw_persos___icone').firstChild;
new Request({
url: url,
data: {
method:'imgclasse',
'classeid':classeid
},
onComplete:function(r){
update.src = 'http://www.forsaken-world.fr/images/stories/fabrik/fw/classes' + r;
document.getElementsByName('fw_persos___icone')[0].value = r;
}
}).send();
I placed
Code:
alert(classeid);
Code:
onComplete:function(r){
But when i replace
Code:
alert(classeid);
Code:
alert(r);
Somebody can say me what is wrong?