We have been working on Microsoft Dynamics Portals for sometime now and we come across scenarios where we need to show/hide fields, make fields required and so on.. Today we will see how we can use Javascript to perform these basic functions. Place all your code in Jquery Document ready function $(document).ready(function () { //your functions }); Disable lookup field if ($("#" + fieldName + "_name").hasClass("lookup")) { disableLookup(fieldName, fieldName + "_entityname"); } function disableLookup(LookupNameID, LookupEntityNameID) { var L_EN_ID = '#' + LookupEntityNameID; var L_N_ID = '#' + LookupNameID; var buttonContainer = $(L_EN_ID).next()[0]; if (buttonContainer != null && buttonContainer.children != null) { for (var i = 0; i < buttonContainer.children.length; i++) { var tagName = buttonContainer.children[i].tagName.toLowerCase(); if (tagName == "button") ...
Comments
Post a Comment