Welcome Guest, Not a member yet? Register   Sign In
jQuery AJAX autocomplete with CodeIgniter
#21

[eluser]yrachmanu[/eluser]
sorry , "it works on all browser except IE " this for rwzhao.

But I've another problem which are :
1. pass the result into another textbox
2. if the value more than 1 , which mean an array . is it possible ??

Thank's before
#22

[eluser]rwzhao[/eluser]
[quote author="naren_nag" date="1242207643"][quote author="rwzhao" date="1242207541"]Have you tried in IE? It is not working in IE I have tested.

Any idea?[/quote]


Which version of IE are you testing in?[/quote]

IE 7
#23

[eluser]bgreene[/eluser]
I had several problems using jquery with ie and solved them all by using post instead of get.
autocomplete was one such problem and was solved by changing $.get(makeUrl(q), function(data) in function requestData(q) to $.get(makeUrl(q)
this might help
#24

[eluser]naren_nag[/eluser]
[quote author="bgreene" date="1242218551"]I had several problems using jquery with ie and solved them all by using post instead of get.
autocomplete was one such problem and was solved by changing $.get(makeUrl(q), function(data) in function requestData(q) to $.get(makeUrl(q)
this might help[/quote]

@bgreene

I think you're absolutely right. I've stopped using get completely, besides making URLs a whole prettier, I think post helps me deal with IE better too.

naren
#25

[eluser]rwzhao[/eluser]
[quote author="bgreene" date="1242218551"]I had several problems using jquery with ie and solved them all by using post instead of get.
autocomplete was one such problem and was solved by changing $.get(makeUrl(q), function(data) in function requestData(q) to $.get(makeUrl(q)
this might help[/quote]

Which file shall change?
#26

[eluser]bgreene[/eluser]
jquery.Autocomplete.js
circa line 330 middle of function requestData(q)
$.get(makeUrl(q), function(data)
change to
$.post(makeUrl(q), function(data)
#27

[eluser]rwzhao[/eluser]
[quote author="bgreene" date="1242904972"]jquery.Autocomplete.js
circa line 330 middle of function requestData(q)
$.get(makeUrl(q), function(data)
change to
$.post(makeUrl(q), function(data)[/quote]

Thanks. I did the change on Nag's jquery.autocomplete.js but still have the same problem. I have error message which says " Object doesn't support this property or method".

Any idea?
#28

[eluser]naren_nag[/eluser]
Could you share the code where you're trying to use this, perhaps there's a bug you're not seeing.
#29

[eluser]rwzhao[/eluser]
[quote author="naren_nag" date="1243330992"]Could you share the code where you're trying to use this, perhaps there's a bug you're not seeing.[/quote]

Here is my controler:

Code:
<?php

class Test extends Controller
{

    function Test()
    {
        parent::Controller();
        $this->load->helper('url');    
        //$this->output->enable_profiler(TRUE);
    }
    
    function index()
    {
        $this->load->view('faq');
    }
}
?>
Here is my view-faq:

Code:
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <base href="<?=base_url();?>" />
      <link rel="stylesheet" type="text/css" href="css/style.css" />
    [removed][removed]
    [removed][removed]
    <link rel="stylesheet" type="text/css" href="js/jquery-autocomplete/jquery.autocomplete.css" />
    [removed]
    $(function() {
            $("#scac_name").autocomplete("/index.php/autocomplete/scac_name",
                { minChars:3, matchSubset:1, matchContains:1, cacheLength:10,
                  onItemSelect:selectItem, selectOnly:1, elementID:'scac' }
                 );
    });

    function selectItem(li, elementID) {
    $("#"+elementID).val(0);
    var setVal = (li.extra) ? li.extra[0] : 0;
    $("#"+elementID).val(setVal);
}


    [removed]
  <title>TEST</title>

</head>

<body>
<label for="SCAC">SCAC</label>
&lt;input type="text" name="scac_name" value="" id="scac_name"&gt;
&lt;input type="text" name="scac" value="" id="scac"&gt;

&lt;/body&gt;

&lt;/html&gt;

I test it in Firefox OK but I.E.
#30

[eluser]naren_nag[/eluser]
Honestly, this has me totally stumped. Would you mind emailing the models, views and controllers to me where you're trying to implement this.

Autocomplete is working for me on IE7 as well as IE8 so I really can't figure it out.

cheers,

Nag




Theme © iAndrew 2016 - Forum software by © MyBB