1
Good afternoon to you all. Guys, I have the following difficulty: I have the following screen:
By clicking on the button highlighted (Edit), this modal window opens, where I pass to it the ID of the request, and the date, as shown in the image:
My difficulty is to reuse the information I have passed on. As you can see, I have been able to pass on this information and retrieve it via javaScript
, only when I submit my form, or try to capture the field value by id, returns me null
.
I passed the information on as follows:
Button that calls the modal, and pass the information through the attribute data-id='$xid|$dataexibir'
<a type='button' href='#editar' class='btn btn-primary espacos' data-toggle='modal' data-target='.editar' data-id='$xid|$dataexibir' id='btnEditar' >
Field that receives the information in the modal window:
<input type="text" class="form-control" name="meuid" id="meuid" disabled="true">
Javascript function I used to pass data:
$(document).on("click", "#btnEditar", function () {
var info = $(this).attr('data-id');
var str = info.split('|');
var meuid = str[0];
var minhadata = str[1];
$(".modal-body #meuid").val(meuid);
$(".modal-body #minhadata").val(minhadata);
});
As you can see in the second image, I try to recover this id to select and fill this table below with the information already contained for that id, and I can’t, nor can I recover or submit through the form. I look forward to some help, and thank you for your attention. Thank you!
Yes, it did. Actually, minutes after posting the question I realized this, and instead of the Bootstrap class, I added an attribute called
readonly="readdonly"
, and solved. Thank you very much @Clayderson Ferreira for the attention and help! :)– José Allison