How to append data to a dropdown in MVC4?

tururu

New Member
Hi all i am appending data to a dropdown dynamically in my application but i have an error here ,the drop downs are created but the values are binded outside the dropdown can any one correct me here where am i doing wrong\[code\] if(product.oPTIONS.length>0) { alert(product.oPTIONS.length); $.each(product.oPTIONS, function (idx, options) { $("#productdetails").append('<label>' + options.OptionName + '</label>'); if(options.value.length>0) { var stringBuilder = []; $("#productdetails").append('<select>'); $.each(options.value, function (idx, values) { stringBuilder.push('<option id="' + values.OptionvalueID + '">' + values.OptionValue + '</option>'); }); stringBuilder.push('</select>'); $("#productdetails").append(stringBuilder.join('')); } });\[/code\]
 
Back
Top