Hi,
I try to use the call to a PHP function under AJAX method.
The goal is to update a text field based on the selection in a dropdown field. To update the text field, request is to be made into the db and calculation has to be executed based on the parameters obtained from the Db.
A take a look to the tutorial and try to apply on my case.
1) save the user_ajax_example.php to a user_ajax.php file in the same directory : .../components/com_fabrik .
2) under class userAjax, a "MontantAPayer" function is set
3) add the javascript "click" event plugin
4) update the javascript code with the following :
5) save and run the form : No result is obtained, field is not updated !
6) redo after activation of firebug. The firebug console error displays the following : Ajax not defined.
Did I miss something?
Many thanks for comments and suggestions.
I try to use the call to a PHP function under AJAX method.
The goal is to update a text field based on the selection in a dropdown field. To update the text field, request is to be made into the db and calculation has to be executed based on the parameters obtained from the Db.
A take a look to the tutorial and try to apply on my case.
1) save the user_ajax_example.php to a user_ajax.php file in the same directory : .../components/com_fabrik .
2) under class userAjax, a "MontantAPayer" function is set
3) add the javascript "click" event plugin
4) update the javascript code with the following :
Code:
var curid = form_9.formElements.get('stdfa_fab_1015___userid').getValue();
var acty = form_9.formElements.get('stdfa_fab_1015___activiteID').getValue();
var adh = form_9.formElements.get('stdfa_fab_1015___adhesionID').getValue();
if (adh != '')
{
var url = 'index.php?option=com_fabrik&format=raw&controller=plugin&c=plugin&task=userAjax';
var update = $('stdfa_fab_1015___decompte');
new Ajax(url,
{
data:
{
method:'MontantAPayer','id':curid,'act':acty,'adh':adh
}
,onComplete:function(r)
{
update.setHTML(r);
}
}).request;
}
6) redo after activation of firebug. The firebug console error displays the following : Ajax not defined.
Did I miss something?
Many thanks for comments and suggestions.