Skip to content

Instantly share code, notes, and snippets.

@afro-coder
Created December 20, 2020 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afro-coder/f298035fc557ae4cafc5092db40154ee to your computer and use it in GitHub Desktop.
Save afro-coder/f298035fc557ae4cafc5092db40154ee to your computer and use it in GitHub Desktop.
Automating exenta and RadDatepicker using Javascript
(function(){
// Click on Apply for WFH button
$('#lnkApplyODRequest').click()
//Set the WFH type
$('#ctl00_mainContent_ApplyOD_ddlOdtype').val(1)
// Day type
$('#ctl00_mainContent_ApplyOD_ddlDayType').val(1);
// Setting the Date. It HAS TO BE (current month(12) - 1)
// YYYY,(MM-1),DD
var fromDate=new Date()
fromDate.setFullYear(2020,11,07)
var toDate=new Date()
toDate.setFullYear(2020,11,11)
//The left hand side datepicker
fromInput=$find('ctl00_mainContent_ApplyOD_raddatefromrequest')
//Right hand side datepicker
toInput=$find('ctl00_mainContent_ApplyOD_raddateToRequest')
var datepickerl=window.fromInput
var datepickerr=window.toInput
datepickerl.get_dateInput().set_selectedDate(fromDate)
datepickerr.get_dateInput().set_selectedDate(toDate)
setTimeout(function(){
$('.startTimeR').val('10:00 am');
$('.endTimeR').val('7:00 pm');
$('textarea').val('WFH');},5000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment