• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
passing extra parameters to autofills

#1
[eluser]bhakti.thakkar[/eluser]
Hi all,
I am using new Ajax.Autocompleter to create autofills in my page. there are two autofills and they are loading well but now i want to make relative. I want to pass value of the first autofill to the second. i tried accessing the value using $this->input->post but its not working

Code in the view :
Code:
new Ajax.Autocompleter("HospitalRelation_ID", "autocomplete_HospitalRelation_ID", base_url+"patients/relation_ajaxsearch_hospital/HospitalRelation_ID/", {} ) ;

new Ajax.Autocompleter("HospitalContact_ID", "autocomplete_HospitalContact_ID", base_url+"patients/Hospitalcontact_ajaxsearch/HospitalContact_ID/", {} ) ;
here i want to pass HospitalRelation_ID to the second autofill.

Controller :
Code:
function Hospitalcontact_ajaxsearch($HospitalContact_ID)
        {
            $conn = $this->dbconnect->connect();
            $function_name = "";
            $function_name = $this->input->post('HospitalContact_ID');
            $HospitalRelationID = $this->input->post('HospitalRelation_ID_Readonly_ID');
            

            $sql = "SELECT  CONCAT(Title_VC,' ',FirstName_VC,' ',Name_VC) DoctorName, Contact_ID FROM contact_t where Relation_ID='$HospitalRelationID' and Name_VC like '$function_name%' ";
            $rs = $conn->getAll($sql, DB_FETCHMODE_ASSOC);

            $output = '<ul>';
            if (count($rs) > 0 ) {
                foreach ($rs as $key => $function_info) {
                    //$output .= '<li><strong>'.htmlentities($function_info[$Name_of_field]).'</strong>';
                    $output .= '<li><span style="display:none">'.$function_info['Contact_ID'].'==></span><strong>'.$function_info['DoctorName'].'</strong>';
                }
                $output .= '</ul>';
            } else {
                $output .= '<li><strong> No records found'.$sql.'</strong>';
            }
            echo $output;
        }

when i print the sql i see that the HospitalRelation_ID_Readonly_ID is not printed which means i am not able to pass HospitalRelation_ID_Readonly_ID to this function

How can i do this?

Thanks in advance


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.