使用jquery填充下拉列表:未在​​表单中发布值

I had to change the values of a dropdown basis the selection of a radio button so i used jquery to check the selected radio button and populated the dropdown accordingly.

Now, when i select a value from the dropdown and submit the form the dropdown value doesnt get posted. Please help. The code i used :

<select style="width:120px;  margin-left:5px;" name="sPriceMin1" id="describe1">
<option value="" selected>Min Price</option> 

in the script :

var listA = [{name:'0', value:'0'}, {name:'10 Lacs', value:'1000000'}, {name:'20 Lacs', value:'2000000'},{name:'30 Lacs', value:'3000000'},{name:'50 Lacs', value:'5000000'},{name:'70 Lacs', value:'7000000'},{name:'1 Cr', value:'10000000'},{name:'1.5 Cr', value:'15000000'},{name:'2 Cr', value:'20000000'},{name:'3 Cr', value:'30000000'},{name:'5 Cr', value:'50000000'}];

$(document).ready( function() {
$('#describe1').empty();                              
      $.each(listA, function(index, value) {
        $('#describe1').append('<option value="'+value.value+'">'+value.name+'</option>');
        });
});

I am unable to fetch the values of the dropdown in my php code. Please help.

Try creating the select option's this way:

$(document).ready( function() {
    var dd = $('#describe1');
    dd.empty();                              
    $.each(listA, function() {
        $("<option />", {
            val: this.value,
            text: this.name
        }).appendTo(dd);
    });
});

Also, make sure that your select is inside the form tag.

Since you did not post the PHP code, it is difficult to tell if this advice will help you.