Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Disabling a field in PDP with JavaScript problem

$
0
0

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"
src="/PWA_01/SiteAssets/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" language="Javascript"
src="/PWA_01/SiteAssets/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
    var element = $("input[title='Project Name']");
    $(element).prop("disabled", true);  
});
</script>


Viewing all articles
Browse latest Browse all 5347

Trending Articles