Welcome Guest, Not a member yet? Register   Sign In
xajax dropdown problem
#1

[eluser]crwtrue[/eluser]
Code:
class Testxajax extends Controller
{

    function Testxajax()
    {
    parent::controller();
        $this->load->library('xajax');
    $this->load->helper('url');
        $this->xajax->registerFunction(array('test_function',&$this,'test_function'));
        $this->xajax->processRequest();
    }

function test_function()
    {
        
        $objResponse = new xajaxResponse();
    $Ol =array();
    $Ol= $this->Cars_model->getCars();
        
    $ret = '';
        
    for($i=0; $i<count($Ol); $i++)
    {
    $ret .= '<option value="'.$Ol[$i]['Model'].'">'.$Ol[$i]['Model'].'</option>';    
    }
        
    $objResponse->assign('cars', 'innerHTML', $ret);
        
        
        return $objResponse;
    }
    
    function index()
    {
    $data = array();
    $data['title'] = 'Test;
    $data['xajax_js'] = $this->xajax->getJavascript(base_url());
    $data['content'] = '&lt;form name="carform" method="post" action="post"  id="carform"&gt;&lt;select name="cars" id="cars"><option value="">(No Selection)</option></select>&lt;/form&gt;';

    $data['main'] = 'testxajax_view';
    $this->load->vars($data);
    $this->load->view('template');
    }
  
}

I installed xajax on my ci application. Iam trying to fill a dropdown with car models but when i click the dropdown it just comes smaller and its empty. Any ideas?




Theme © iAndrew 2016 - Forum software by © MyBB