Menu icon Foundation
How to pass a variable using Reveal Dialogs

Hi,

I am trying to delete a selected variable into a PHP-while loop passing the $_GET['id'] variable, but when I call the Reveal Dialog that $row['id'] has been cleared to the first row of the while loop. I do not know how to pass the correct $row['id'] variable. Please help.

Thanks

<!-- DELETE REVEALFORM -->
        <?php echo '<td class="small-offset-1 small-1 columns end"><a href="delete.php?id='.$row['id'].'"" data-reveal-id="deleteModal" class="button tiny alert end">Delete</a></td>' ?>
<!-- DELETE REVEALFORM -->


<!-- DELETE Reveal Modals begin -->
<div class="row">
<div class="small-12 columns">
<div id="deleteModal" class="reveal-modal small" data-reveal aria-labelledby="firstModalTitle" aria-hidden="true" role="dialog">
  <h2 id="firstModalTitle">Are you sure that you want to delete?</h2>
  <div class="small-12 columns" >
  <a class="close-reveal-modal small-offset-3 button tiny success">Cancel</a>
  <?php echo '<a href="delete.php?id='.$row['id'].'"" class="small-offset-1 button tiny alert">Delete</a></td>' ?>
  </div>
  <a class="close-reveal-modal" aria-label="Close">&#215;</a>
</div>
</div>
</div>
<!-- DELETE Reveal Modals ends -->
            

         

Reveal Dialog

Hi,

I am trying to delete a selected variable into a PHP-while loop passing the $_GET['id'] variable, but when I call the Reveal Dialog that $row['id'] has been cleared to the first row of the while loop. I do not know how to pass the correct $row['id'] variable. Please help.

Thanks

<!-- DELETE REVEALFORM -->
        <?php echo '<td class="small-offset-1 small-1 columns end"><a href="delete.php?id='.$row['id'].'"" data-reveal-id="deleteModal" class="button tiny alert end">Delete</a></td>' ?>
<!-- DELETE REVEALFORM -->


<!-- DELETE Reveal Modals begin -->
<div class="row">
<div class="small-12 columns">
<div id="deleteModal" class="reveal-modal small" data-reveal aria-labelledby="firstModalTitle" aria-hidden="true" role="dialog">
  <h2 id="firstModalTitle">Are you sure that you want to delete?</h2>
  <div class="small-12 columns" >
  <a class="close-reveal-modal small-offset-3 button tiny success">Cancel</a>
  <?php echo '<a href="delete.php?id='.$row['id'].'"" class="small-offset-1 button tiny alert">Delete</a></td>' ?>
  </div>
  <a class="close-reveal-modal" aria-label="Close">&#215;</a>
</div>
</div>
</div>
<!-- DELETE Reveal Modals ends -->
            

         
Francis Chung about 3 years ago

Hi there, I was wondering if you ever figured this out? 

Thanks in advance.

Andres Suarez over 2 years ago

Use the bootstrap way, I'm think it should work here too.

http://getbootstrap.com/javascript/#modals-related-target