Good day..
i have modal and inside the modal i have div class
<div id="user-details-content" class="modal-body">
...
</div>
i supply the content inside that modal using ajax.
this is the supplied content:
<div id="hidden" class="hidden">
<input type="hidden" name="id" class="id" id="id" value="1">
<input type="hidden" value="email@email.com" class="email">
</div>
Now i try to get that input type="hidden" using this ajax
var id = $(this).parents('#user-details-content').find('.id').val();
but it returns undefined in my console.log
any suggestions ? on how to get that input type="hidden" and the value ?
EDIT - This is my ajax function
function inquiryId(){
var id = $(this).parents('#user-details-content').find('.id').val();
console.log(id);
$.ajax({
url: 'php_file.php',
type: 'POST',
data: { id: id,
},
dataType: 'json',
success: function(result){
console.log(result);
}
});
}