Project

General

Profile

Actions

Defect #34167

closed

when i put if condition and update any field the if condition field lost data

Added by moustafa elbeda over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

$(document).on('click', '.update', function() {
var user_id = $(this).attr("id");
$.ajax({
    url: "fetch_single.php",
    method: "POST",
    data: {
        user_id: user_id
    },
    dataType: "json",
    success: function(data) {
        $('#userModal').modal('show');
        $('#name').val(data.name);
        $('#status_id').val(data.status_id);
        $('#note').val(data.note);
        $('#note_tow').val(data.note_tow);
        $('#note2').val(data.note2);
        $('#note3').val(data.note3);
        $('#payment').val(data.payment);
        $('#ntg_no').val(data.ntg_no);
        $('.modal-title').text("تعديل الحالة");
        $('#user_id').val(user_id);
        $('#action').val("Edit");
        $('#operation').val("Edit");

        if ($("#note").val() !== '') {
            $("#note").prop("disabled", true);
        } else {

            $("#note").prop("disabled", false);
        }
    }
});
});

I am using a JQuery model form with Ajax to allow users to enter new values and update in text area I put condition statement depend on field value NULL OR NOT NULL after success but when update any field
the condition field(note) lost data

Actions #1

Updated by Go MAEDA over 3 years ago

  • Description updated (diff)
Actions #2

Updated by moustafa elbeda over 3 years ago

when i put if statement filed note is cleared after update any field

Actions #3

Updated by moustafa elbeda over 3 years ago

0

the issue is solved replace disable to readonly

Actions #4

Updated by Go MAEDA over 3 years ago

  • Category deleted (Issues)
  • Resolution set to Invalid

Please use forums for questions. Issues are used to report a bug, suggesting a new feature, or submitting a patch. Reading How to request help may be helpful for you.

Actions #5

Updated by Go MAEDA over 3 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF