Script - From Select/Input to Datalist

Good Evening All!

I have a quick question, how do I convert the following two scripts to work using a datalist? I currently have it set up to function on a select/drop down, but have since discovered the datalist version of drop downs and it suits my needs more than the select.

Using either of these does not work with the datalist.

Script One (fills inputs based one another input)

  $( function() {

        source: "search.php",
      minLength: 1,
      select: function(event, ui) {
        //Here $(this) points to the current autocomplete input element
  } );

Script Two (fills an input based on a drop down’s selection)

    function siteaddress(){
        var address = $('#site_name').find(':selected').data('site_address');

Any help would be greatly appreciated!

What have you looked into?

Sponsor our Newsletter | Privacy Policy | Terms of Service