Jump to content

Help with jquery autocomplete and PHP form...


A JM

Recommended Posts

I have a PHP form that is currently using the jquery datepicker (1.7.2, yes I know old..) but for the life of me I can't figure out why I can't get the autocomplete (https://jqueryui.com/autocomplete/) to work. It's not firing the autocomplete function unless I do a page refresh however my datepicker is working fine...

 

Should/Can I just add the autocomplete to the datepicker function, will that work or does it need to be a seperate function?

 

Initially I had 2 seperate function()  <Script>> and realized that probably wasn't going to work since the function name was the same...

<script type="text/javascript">
    $(function() {
    var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];

        $("#vis_los_date").datepicker({changeMonth: true,changeYear: true,
            onClose: function(set_date) {
                 document.getElementById('los_date').value = document.getElementById('vis_los_date').value;
                 }
        });

        $( "#tags" ).autocomplete({
          source: availableTags
        });
    });
</script>

Looking for some suggestions or thoughts... thanks.

 

A JM,

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.