Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a dropdown in an edit form that is disabled via jquery/javascript. When I go in and edit an item/record, save it, and reopen it, the selected value in the dropdown gets reset to its default value. When I remove the javascript that is disabling the control, the values don't get reset. The drop down only has two values; open and closed. he default is open. Here is the javascript:

$(function() {
        $("select[title$='Procurement Stage']").attr('disabled', 'disabled');
}
share|improve this question

2 Answers 2

The field has to be enabled prior to submission, typically via the PreSaveAction function.

Marc has it demonstrated here, I swapped in your code:

$(document).ready(function() {
        $("select[title$='Procurement Stage']").attr('disabled', 'disabled'); 
    });

    function PreSaveAction() {
        $("select[title$='Procurement Stage']").attr('disabled', ''); 
        return true;
    }
share|improve this answer
    
Got it. I also found this: jbmurphy.com/2010/06/01/… I guess disabled controls don't get thier values posted. Thanks. –  Steve Jun 11 '12 at 20:23

I used the below line in my PreSaveAction() but still the drop-down doesn't get enabled.

$("select[title$='Status']").attr('disabled', ''); 

But the below line is making the status disable properly:

$(document).ready(function() {
        $("select[title$='Status']").attr('disabled', 'disabled'); 
    });
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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