I have the following code and that pulls a number of records based on a SELECT statement and get_test_results as the variable for that statement. It displays fine on the web page with the name as the title and the corresponding values (in div id=inline) that go with that record as a list underneath. The issue is when I add a div to display none before the div id=inline and invoke the fancybox code to display as a popup then no matter whatever the name I click it just shows the values for the wrong record. It basically starts at the first record and goes to the next no matter what name is clicked. Any help appreciated as always or alternatives to fancybox that will work.
foreach ( $get_test_list as $record ) {
<li id=test-list>
<a href="#inline" class="various" title="<?php echo $record->name; ?>"><?php echo $record->name; ?></a>
</li>
<div id="inline">
<ul>
<li><?php echo $record->test_code; ?></li>
<li><?php echo $record->name; ?></li>
<li><?php echo $record->components; ?></li>
<li><?php echo $record->cpt_code; ?></li>
<li><?php echo $record->preferred_specimen; ?></li>
<li><?php echo $record->alternate_specimen; ?></li>
<li><?php echo $record->method; ?></li>
<li><?php echo $record->clinical_indication; ?></li>
<li><?php echo $record->turnaround_time; ?></li>
</ul>
</div>
Thanks,
Deon
Umm you need to have unique IDs, it looks like you loop through and re-use the SAME ID #inline.
So each time you are trying to call any number of the same IDs. Make them unique and it should work as expected.