Transfer data-id to multiple modals


Ask A Question





Login To post a question

I have this table:

       <table class="table">
    <tr>
    <td class="detail">
       <a class="btn btn-default btn-xs" href="" data-email="<?php echo $us->email; ?>">Email</a>
<a class="btn btn-default btn-xs" href="" data-id="<?php echo $us->id; ?>">Profile</a>
    </td>
    </tr>
    </table>

And I get data-email value with this javascript:

<script>
$('.table .detail a').click(function(e) {
  e.preventDefault();
  var email = $(this).data('email');

  $.ajax({
    url: 'admin/send_email.php?token=<?php echo $token; ?>',
    data: {email: email},
    type: 'GET',
    dataType: 'HTML'
  }).done(function(resp) {
    $('#modalContent .modal-body').html(resp)
  $('#modalContent').modal('show');
  });
});
</script>

How I can get data-id in another modal? I have tried adding class id in class="btn btn-default btn-xs" but don’t work!

For more info please click herehttps://stackoverflow.com/q/50375112



Have a question or need a custom quote?
info@smartinfocare.com