Quote Originally Posted by Pullo View Post
Ok, well it sounds like we're almost there.
What we need to know is what toselectdropdown.php is returning when you have select * from employee in your code.
Can you therefore change this:

Code JavaScript:
success:function(data)
    {
      var items = [];
      $.each(data, function(key, val) {
        items.push('<option value="' + key + '">' + val + '</option>');
      });
      $('<select/>', {
        'class': 'my-new-select',
        html: items.join('')
      }).appendTo('body');
    }

back to this:

Code JavaScript:
success:function(data)
    {
      console.log(data);
    }

and post the output.

Cheers.

BTW, Array.join() is a method which joins the elements of an array into a string, and returns the string.
Hi pullo,

Thank you for the reply...do i need to do this?
$('<select/>', {
'class': 'my-new-select',
html: items.join('')
}).appendTo('body');

but i have already <select> element in my html...
my html code goes something like this
Code:
    
 <label>choose</label>

<select id="optselect">
  <option></option>
</select>