0

I'm having problems in passing values ​​to the function using jquery when I select the two dates as below:

enter image description here

This takes the values ​​that are in the text as shown, but I would take the values ​​and pass to the function below

var dtLev = $("#dateLev option:selected").text() 

$.getJSON("/Grafic/GetDateByGraf", { selectedRodId: rodId, selectLevId: levId, selectDtLev: dtLev},

If I use .Val() the null value appears

How can I fix this

tereško
  • 58,060
  • 25
  • 98
  • 150
rysahara
  • 346
  • 1
  • 6
  • 23

1 Answers1

0

got this way,

var selectedOptions = $.map($('#dateLev :selected'),
function (e) { return $(e).val(); });
var dtLev = selectedOptions.join(',');
rysahara
  • 346
  • 1
  • 6
  • 23