Jump to content

Help with jquery autocomplete and PHP form...


A JM
Go to solution Solved by 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,

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.