Extracting text from PHP generated paragraph, populating modal form field

Extracting text from PHP generated paragraph, populating modal form field

Hi everyone,

  I am trying to populate a modal form with information from a MySQL database, the text is inserted into a DIV with a PHP WHILE loop, like so:

  1. <?php while ($linkDetails = mysql_fetch_assoc($getLinks)) {?>
  2.                 <div class="linkBox ui-corner-all" id="linkID<?php echo $linkDetails['id'];?>">
  3.                     <div class="linkHeader"><?php echo $linkDetails['title'];?></div>
  4.                     <div class="linkDescription"><p><?php echo $linkDetails['description'];?></p>
  5.                     <p><strong>Link:</strong><br/>
  6.                     <span class="link"><a href="<?php echo $linkDetails['url'];?>" target="_blank"><?php echo $linkDetails['url'];?></a></span></p></div>
  7.                        
  8.                             <div class="control">
  9.                                 <p align="right">
  10.                                     <span class="delete addButton ui-state-default">Delete</span>
  11.                                     <span class="edit addButton ui-state-default">Edit</span>
  12.                                 </p>
  13.                             </div>
  14.                        
  15.                 </div>
  16.                 <?php }?>
The Edit button opens a modal jQuery form dialog and I need to insert the retrieved data into the form fields for that specific record, which in this case includes a title, description, and URL for a website. How can I do this while ONLY retrieving that link's details? Note that all of the DIVs have their own ID generated by the WHILE loop.

Thanks,

Ben