How开发者_StackOverflow社区 can I get the value from a select field (dropdownlist) into a "code nugget" using jQuery? I have seen this done, but can't find an example of it now.
I have two dropdownlists, and I want to get the selected values from them and concatenate it into an id parameter to send to an action method:
$.get('<%= Url.Action("GetTasks","Timesheet", new { id = [Concatenated value here] } %>'
How can I get the concatenated selected values from the two dropdownlists with jQuery?
You could try something like this:
var url = "<% Url.Action("GetTasks", "Timesheet", new { id = "{0}" }) %>";
var selected = $("#mySelect").val().join(",");
url = url.replace("{0}", selected);
$.get(url);
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论