I have written this code for redirecting to a different site when Approved or Rejected it is working fine but I have a mandatory field in that task list and with out filling the mandatory field also if we click on the reject and approve button it is redirecting to that URL what can i do to not work when mandatory field is not filled.
$("input[Value$='Rejected']").click(function(){
window.location="