Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
themeMidnight
titleUpdate Dismissed EmployeeCustom Approve, Reject and More Info Button
linenumberstrue
collapsetrue
// Change the size and color of the buttons
document.getElementById('form[rejectBtn]').setAttribute("style","background:red;border:1px solid #eeeeee;width:150px;");	
document.getElementById('form[approveBtn]').setAttribute("style","background:green;border:1px solid #eeeeee;width:150px;");
document.getElementById('form[moreinfoBtn]').setAttribute("style","background:#3397e1;border:1px solid #eeeeee;width:150px;");

// Add events on the buttons
document.getElementById('form[rejectBtn]').onclick = function() {
  document.getElementById("form[approval]").value = '2';
  document.forms[0].submit();
}

document.getElementById('form[approveBtn]').onclick = function() {
  document.getElementById("form[approval]").value = '1';
  document.forms[0].submit();
}

document.getElementById('form[moreinfoBtn]').onclick = function() {
  document.getElementById("form[approval]").value = '3';
  document.forms[0].submit();
}

...