Disabling a field in PDP with JavaScript problem RRS feed

  • Question

  • Hello,

    I am attempting to disable a field on PDP with JavaScript.  It works fine on page load, but after clicking 'Save', the field is enabled again.  Looking at the source of the page, I see function(bEnable) which looks to re-enable all of the fields after a save.  So, my question is how do I persist disabled fields through JavaScript across save clicks?  Thanks!  (JavaScript to disable field below:)

    <script type="text/javascript" language="Javascript"
        <script type="text/javascript" language="Javascript"
    $(document).ready(function() {
        var element = $("input[title='Project Name']");
        $(element).prop("disabled", true);  

    Saturday, September 13, 2014 5:38 PM

All replies

  • Hi,

    Have you tried using onload instead of ready? Also, I've used in the past readOnly instead of disabled


    Monday, September 15, 2014 2:21 PM
  • I ended up fixing by creating the below function:

    function DisableAfterSaveJSInjection(WPDPParts)
        for (var i = 0; i < WPDPParts.length; i++)
            if(typeof(WPDPParts[i].EnablePart) == "function")
                var oldMethod = WPDPParts[i].EnablePart;
                WPDPParts[i].EnablePart = function(bEnable)
                    var retVal =, bEnable);
                    return retVal;

    Monday, September 15, 2014 5:18 PM