javascript - To get selected id of the dropdown -


in below code have dropdown in want selected id of product dropdown .pls me this.

to id of product:

 function myfunction() {         $.ajax({             type: "post",             url: "orderform.aspx/insertdata",             data: "{'productid':'" + $("#<%=productname.clientid%>").val() + "','quantity':'" + $("#<%=txtquantity.clientid%>").val() + "'}",             contenttype: "application/json; charset=utf-8",             datatype: "json",             async: "true",             cache: "false",             success: function (msg) {                 alert("success");                 // on success                              },             error: function (x, e) {                 alert("fail");                 // on error             }         });      }   
<editable:editabledropdownlist id="productname" runat= "server"  cssclass="cbproductname" style="width:40%;" enableviewstate="true"   /> 

you need @ editable:editabledropdownlist.
because select needs value="this.id" in loop.
don't know framework or plugins using, search in documentation options select value of options in select.
if dont define value select send displayed name default value option.

<option value="1">soap</option> 

will send "1"

<option>other</option> 

will send "other"


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -