ajax



<form action="#">
    <select name="groupid" id="groupid">
      <option>Slower</option>
    </select>
    
</form>

<script>
$.getJSON( "AjaxGroup.php?action=list", function( data ) {
  if(data.Result=="OK"){
    var sel = $("#groupid");
    sel.empty();
    for (var i=0; i<data.Records.length; i++) {
	sel.append('<option value="' + data.Records[i].GroupId + '">' + data.Records[i].Name + '</option>');
    }					
  }			  
});
</script>


Leave a Reply