I'm using following html for dropdownlist,
<select id="dd">
<option>Select ReportType</option>
<option value="1">Blocked Details</option>
<option value="2">Supervisor Input</option>
</select>
Following code for a button,
<input type="button" name="Excel" value="ExportToExcel" onclick="javascript:DownloadExcel($('#dropdown').val());" />
Following is the Jquery function,
function DownloadExcel(value)
{
debugger;
if(value=="Blocked Details"){
value="1";
}
else if(value=="Supervisor Input"){
value="2";
}
$.ajax({
url:"@Url.Action("TravelReadyAdminDownload", "TravelReady")",
datatype:"html",
type:"post",
data:{Id:value},
error:function(){},
success:function(data){
window.location.href=data.url;}
});
}
is it possible to get the dropdown values("1/2" instead of "Blocked Details/Supervisor Input").What is the javascript i need to use to get the value in that function?