0

I created two extra html form fields and when we fetch data using requestID then all form fields disabled including that fields i created so i want help that how i will show all forms fields disabled excluding that two fields:here is the code for all fields disabled

$('#FirstSection').find('input, textarea, button, select').attr('disabled', 'disabled');
$('input[type="text"], input[type="checkbox"], input[type="email"], input[type="number"], textarea, select').prop("disabled", true);
$('input[type="text"], input[type="checkbox"], input[type="email"], input[type="number"], textarea, select').attr("disabled", "disabled");

The two fields that i created are textarea fields:

<div class="col-md-8">
    <textarea name="DescribeChanges" id="RevisionChanges" class="form-control"></textarea>
</div>
<div class="col-md-8">
    <textarea name="RevisionReason" id="RevisionDiv" class="form-control"></textarea>
</div>
0
 function Retrieve(requestID) {
    var getItemsUrl = "/_api/Web/Lists/GetByTitle('" + ListName + "')/items?$select=ID,Title,&$filter=(ID eq " + requestID + ")";
var promise = $.ajax({
    url: _spPageContextInfo.webAbsoluteUrl + getItemsUrl,
    type: "GET",
    headers: {
        "accept": "application/json;odata=verbose",
    },
    success: function (data) {

        console.log(data.d.results);


        if (data.d.results.length > 0) {
            var ArrayRetrieved = data.d.results[0];
            console.log(ArrayRetrieved);
            //LICENSES
            $("#idF").val(ArrayRetrieved.ID); //You have to add this HIDDEN field to your HTML : <span name="ID" type="text" id="idF" style="display:none" />
            $("#RevisionChanges").html(ArrayRetrieved.Title); // Title is the internal name of your column

 }
    },
        error: function (error) {
        console.log("Error on Retrieve");
        console.log(JSON.stringify(error));
    }
});

}

0

You could use the not-selector:

[...] , textarea:not("#RevisionChanges,#RevisionDiv") [...]

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.