Hello,
When this JS run on the dropdown element and called the php ajax, the value return is coming for some data and not for other data.
Why is that? I copied those code from one QnA and edited.
When this JS run on the dropdown element and called the php ajax, the value return is coming for some data and not for other data.
Why is that? I copied those code from one QnA and edited.
JavaScript:
jQuery.ajax({
url: 'index.php?option=com_fabrik&format=raw&task=plugin.userAjax&method=getSEQ&tid=' + this.getValue(),
method: 'get',
context: this
}).done(function (r) {
/*debugger;*/
IDShowTmp = r;
});
PHP:
class UserAjax
{
public function getSEQ()
{
$db = FabrikWorker::getDbo();
$query = $db->getQuery(true);
$app = JFactory::getApplication();
$input = $app->input;
$TeaId = $input->get('tid', '');
$query->select('MAX(kseqID)')->from('tk')->where('tid = ' . $db->quote($TeaId));
$db->setQuery($query);
$rett = ($db->loadresult())+1;
echo $rett;
}