Tuesday, September 30, 2014

Validating fields in WrkTaskIP page

Hi,


I have fixed this issue, by doing the below:


1) Create a copy of the existing OOB "WrkTaskIP.aspx". Create a new page with it, and then refer the newly created page.


2) In the newly created page, add the below:



$(document).ready(function ()
{$("input[value='Reject']").prop("disabled",
true);
$("textarea").keyup(function () {

if ($(this).val() != "") {

$("input[value='Reject']").prop("disabled",
false);
}
else {

$("input[value='Reject']").prop("disabled",
true);
}
});


$("input[value='Reject']").parent("span")
.prop("onmouseover",
null)
.prop("onmouseout", null);

});

The above code does the below:


In page load, disables the Reject button. when some item is entered in the textarea, the reject button is enabled. This way we can make the comments as a mandatory field to click the reject button.


Hope it helps.


Thanks


No comments:

Post a Comment