Mar 4, 2016

How to disable kwizcom cascading lookup field using jquery

Since kwizcom is 3rd party tool, it creates multiple controls like input, span etc in its html . Also we will be not be able to find the field id as its all html control without id. so we can find the td of the control and make it disable . This would be the better option.

I am identifying the td by searching for its label name in the SharePoint list form and then abviously the next td will be the container of the cascading lookup control. So the below code works fine.

<script src="" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('nobr:contains("Label")').closest('td').next().find("*").attr("disabled", "disabled"); // IE
$('nobr:contains("Label")').closest('td').next().css("pointer-events" , "none"); // Chrome