1

I have a SharePoint 2013 taxonomy field in my site called "Status" and I want to disable it in the new form of the list. Here is what I have done.

var controlHondaStatus = getManagedMetadataField("Status");
controlHondaStatus.children().attr("disabled", "disabled");

function getManagedMetadataField(internalName) {
    var field = findFieldByInternalName(internalName);
    field.Control = field.find("div.ms-taxonomy-fieldeditor");
    field.Value = field.Control.find("span.valid-text").text();
    return field;
}

But with that implementation the text box of the taxonomy field gets disabled but I can still click the pick list and change the value. enter image description here

Is there a way to disable that pick list, too?

3

Disabling the image didn't work for me. Replace the image tag with the same markup, so that the OOTB click event handler detached from UI.

var imgNode = $(document.getElementById('name_$containercontrolHolder')).children('img.ms-taxonomy-browser-button').eq(0);
    var s = jQuery("<p>").append(imgNode.clone()).html();
    imgNode.replaceWith(s);
1

Try below code. It works for me:

<style type="text/css">
.mr-taxonomy-browser-button{ display:none;
}</style>

and then I use this in my code:

$("#IdOfField1").attr('disabled', true).addClass('mr-taxonomy-browser-button'); 

where #IdOfField1 is the ID of the taxonomy field.

  • <span disabled="disabled" > <span> <div> <div> <img width="15" class="ms-taxonomy-panel-resizer" unselectable="on"> i have the image like this. now i need to find that image and make it disabled using jquery – ChathuraSam Sep 3 '15 at 5:22
0

//Below is working for both IE and Chrome //Disable text box of the taxonomy field $('div[id="name_$containereditableRegion"]').prop("contenteditable", "false").css('background-color','#F6F6F6');

//Disable Managed Meta Data Browse button var imgNode = $(document.getElementById('name_$containercontrolHolder')).children('img.ms-taxonomy-browser-button').eq(0); var s = jQuery("

").append(imgNode.clone()).html(); imgNode.replaceWith(s);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.