locked
set readonly for the textbox control useing ajax RRS feed

  • Question

  • User-1722422105 posted

    Hi 

    how to set read only for the  $('#EmployeeID').val(result.empid);control ,,below my code

    $.ajax({
    url: "/Home/getbyID/" + EmpID,
    typr: "GET",
    contentType: "application/json;charset=UTF-8",
    dataType: "json",
    success: function (result) {
    $('#EmployeeID').val(result.empid);
    $('#Name').val(result.Name);
    $('#Age').val(result.Age);
    $('#dobs').val(result.dateofbirth.parseNETDate());
    $('#add').val(result.address);

    $('#myModal').modal('show');
    $('#btnUpdate').show();
    $('#btnAdd').hide();
    },
    error: function (errormessage) {
    alert(errormessage.responseText);
    }

    Tuesday, June 19, 2018 11:21 AM

Answers

  • User-369506445 posted

    hi

    if you want read-only the input , you can use below code :

     $('#EmployeeID').attr('readonly', true);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 19, 2018 11:31 AM

All replies

  • User-369506445 posted

    hi

    if you want read-only the input , you can use below code :

     $('#EmployeeID').attr('readonly', true);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 19, 2018 11:31 AM
  • User-1722422105 posted

    Hi

    one dout

    i  have div class="form-group"  inside this after  and after

    <a id="mylink" href="http://localhost:53173/Uploads/53/Uploaded.jpg" style="display:none;" onclick="func()" ; return false;">Open file</a>

    i want anchor tag dynamically.

    /////////////////////////////////////////////////////////////////////////////////

    <div class="form-group">
    <label for="Taxfiles">Tax files</label>
    <input type="text" class="form-control" id="lbl1" readonly="readonly" />

    <input type="file" class="form-control" id="FileUpload1" multiple placeholder="Tax Files" />
    <a id="mylink" href="http://localhost:53173/Uploads/53/Uploaded.jpg" style="display:none;" onclick="func()" ; return false;">Open file</a>

    ///////  here  
    </div>

    Friday, June 29, 2018 3:32 AM