Welcome Guest, Not a member yet? Register   Sign In
Ajax help

[eluser]Nutan Lade[/eluser]
I am trying to implement an autocomplete field.I am getting the results from the db but I am not able to navigate through the results.And my code is..

    //var url = "http://localhost/Gadgets/index.php/gadgets/searchMovie/"+document.getElementById(movieSearch);
    function ajaxSearchMovie(url){
    new Ajax.Request(url,
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      document.getElementById('autocomplete_choices')[removed] = response;
      alert("Success! \n\n" + response);
    onFailure: function(){ alert('Something went wrong...') }

            <td>&lt;input type="text" id="autocomplete" name="autocomplete" autocomplete="off"&gt;&lt;/td>
            <td></div--&gt;<div id="autocomplete_choices" class="autocomplete"></div></td>

Please help me to solve thie problem.What should do after retuurning the results.
Thanq in advance.

There are libraries that handle AJAX autocomplete pretty well:

scriptaculous: http://github.com/madrobby/scriptaculous...ocompleter
jQuery: http://www.google.com/search?q=jquery+ajax+autocomplete

Good luck

Theme © iAndrew 2016 - Forum software by © MyBB