User6861111 posted
Hi Sir,
I have been asked to code as - When user clicks and DOWNLOAD Button, it has to check whether user has selected any option from two different dropdown buttons.
If they have selected the Options and click the DOWNLOAD Button then it allows to download the data. But when user clicks download without any selection in dropdown then a Message should popup " Choose the values from Calendar Year and Account". (Note:
In default the OPTION "ALL" will be selected but when user clicks Download button it should asks to select any other options from Calendar Year and Account)
Just need to set this criteria in the below code.
$('#btnDownloadSU').bind('click', function () {
$.messager.confirm('Go to download spreadsheet data file?', 'Are you going to download spreadsheet data file ?',
function (isOk) {
if (isOk) {
var date = new Date();
var fileName = userID + '_' + date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear() + "-" + date.getHours() + date.getMinutes() + date.getSeconds();
//open the download window to download file
window.open('../DataServices/ActualCostsVSPOR.ashx?action=SUAccountVariance&'
+ '&FileName=' + fileName
+ '&Account=' + Accounts.GetCheckedItems().IDs
+ '&CalYear=' + CalYear.GetCheckedItems().IDs);
}
});
});
Please help, i am strugling in this for past 2 weeks.