user3290489 user3290489 - 6 months ago 19
HTML Question

When user clicks checkbox I want them to go to the class "areaEditable hide" for user to see the edit, I believe a JQuery function does the job?

if (Model.OrderStatus == OrderStatus.ReadyForDespatch && Model.OrderItems[i].Status == OrderLineStatus.ReadyForDespatch)
<div class="areaEditable hide">

@Html.EditorFor(m => m.OrderItems[i].QuantityForDespatch, new { htmlAttributes = new { @class = "form-control pcss-quantity-for-despatch pcss-hide-for-picklist ", @placeholder = "Quantity", @type = "text" } })
<span class="orderqtyerror pcss-qty-min-max-message hidden-print" style="display:none;">Please enter valid Quantity.</span>

        $('#editorderfulfilment').change(function (e) { //Function to go to editorderfulfilment checkbox
            if ($('#editorderfulfilment').is(':checked')) { //If editorderfulfilment checkbox is checked
                var editableCounter=0;
                $(".areaEditable").each(function (index) { //areaEditable function
                    if ($(this).closest("td").closest("tr").find("input.pcss-product-order-status").val() == "ReadyForDespatch") //if closest td closest tr order status equals ready for dispatch
                        $(this).show(); //show editable area
                        $("th.areaEditable").show(); //areaEditable show