Hi,
You could write javascript function and register the function.
function DisableHTMLWebresouceAndSubgridControl() {
//Get the field value
var fieldValue = Xrm.Page.getAttribute("attributename").getValue();
//Get HTML web resource control
var webRefCtrl = Xrm.Page.getControl("WebResource_WebResourceName").getObject();
//Get Subgrid control
var subGridCtrl = window.parent.document.getElementById("SubgridName_span");
//If web resource and subgrid are not loaded yet, then call same function after some time.
if ((webRefCtrl == null) || (subGridCtrl == null)) {
setTimeout(DisableHTMLWebresouceAndSubgridControl, 1000)
return;
}
//Check the required condition
if (fieldValue == null) {
//web resource HTML document
var htmlDoc = webRefCtrl.contentDocument;
//get list of controls by tag name
var ctrlList = htmlDoc.getElementsByTagName('select');
//get list of controls by Id
var ctrlById = doc.getElementById('textCtrl');
// disable control in HTML web resource.
ctrlList[0].disabled = true;
// disable the subgrid control
subGridCtrl.disabled = true;
}
}
Hope this helps.