Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Repeating Tables

Thread began 4/24/2012 1:12 am by Paul | Last modified 4/24/2012 10:07 pm by Jason Byrnes | 479 views | 3 replies |

PaulBeta Tester

Repeating Tables

Using CS5.5

I have applied this the repeating table to my page replacing tables with DIV tags and my images load ok.

I want to wrap the whole thing in an update form and add a radio button so i can change the images show flag field in mysql between 0 and 1. Only one image can have the show flag value as 1, the others must be 0.

The image displayed with a show flag of 1, will have its radio enabled and the other 0.

Any ideas?

Sign in to reply to this post

Jason ByrnesWebAssist

add a form around the repeating table.

add the radio button to each cell, set the value for the radio button to the ID of the image. each radio button should have the same name to create the radio group.


you will need to have 2 update record behaviors on the page.

1) to set all of the records show field to 0. in the update record behavior, set the key column to the show field and set the key value to 1. then in the update section, set it to change the show field to 0.

2) this one will set the show field for the selected image. set the key column to the image ID, set the key value to use the radio group. then in the update section set the value for the show field to 1.

Sign in to reply to this post

PaulBeta Tester

Thanks for quick response Jason.

I've attempted the first part, adding the form tags around my repeating DIV (table) and configuring the radio button with the value set to the image index. Thus..

php:
<label class="label_radio" for="radio-01"><input name="PrimeImage" id="PrimeImage" value="<?php echo $row_ShowMyPics['hopicsidx']; ?>" type="radio"  /> Set as Primary</label>



Where the binded value

php:
<?php echo $row_ShowMyPics['hopicsidx']; ?>

is returned from my image recordset.

However, when applied and run, each radio button stays selected as each is clicked on. Not expected behaviour.

I want to get this right before moving onto second part of solution.

Below is the form content

php:
<form action="" method="post" id="contact-form" class="contactForm">
             <ul id="portfolio-list">
            <?php if ($totalRows_ShowMyPics 0) { // Show if recordset not empty ?>
            
            <?php do { ?>  <?php
    
// RepeatSelectionCounter_1 Begin Loop
    
$RepeatSelectionCounter_1_IterationsRemaining $RepeatSelectionCounter_1_Iterations;
    while(
$RepeatSelectionCounter_1_IterationsRemaining--){
        if(
$RepeatSelectionCounterBasedLooping_1 || $row_ShowMyPics){
?><li class="<?php echo $row_ShowMyPics['hopicname']; ?>">
      <?php
if(TRUE){ // Begin Cached Resized Image: ImageCacheInstance_1334080310087
ob_start();
?><img src="<?php echo $row_ShowMyPics['hopicfolder']; ?><?php echo $row_ShowMyPics['hopicimagename']; ?>" alt="Click for full photo" width="200" height="200" ><p class="item-title">
<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "../../../image_cache""crop"""false));
// End Cached Resized Image: ImageCacheInstance_1334080310087
?><span class="tag-status" style="line-height:20px;"><img src="../../images/tag-icon.png" alt="" style="width:16px; height:16px;"><?php echo $row_ShowMyPics['hopicname']; ?> [<?php echo $row_ShowMyPics['hopicsidx']; ?>]</span> </br>
<p><?php echo $row_ShowMyPics['hopicimagename']; ?></p>
<div class="overlay"><a href="managepic1.php?PID=<?php echo $row_ShowMyPics['hopicsidx']; ?>"></a>Click to edit</div>
      <div class="colorbox"></div>
      <label class="label_radio" for="radio-01"><input name="PrimeImage" id="PrimeImage" value="<?php echo $row_ShowMyPics['hopicsidx']; ?>" type="radio"  /> Primary</label>
    <br/>   
    </li><?php
    
// RepeatSelectionCounter_1 Begin Alternate Content
    
else{
?><li><?php // RepeatSelectionCounter_1 End Alternate Content
        
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
            if(!
$row_ShowMyPics && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining 0;}
            
$row_ShowMyPics mysql_fetch_assoc($ShowMyPics);
        }
        
$RepeatSelectionCounter_1++;
    }  
// RepeatSelectionCounter_1 End Loop
     
?>
     <?php } while ($row_ShowMyPics mysql_fetch_assoc($ShowMyPics)); ?>
              <?php // Show if recordset not empty ?>
     </li></ul></form>



The form as you will notice isnt set to do anything for this issue. It also uses WA Image resizer, but I'm not aware thats affecting anything.

Any ideas why I'm getting this behaviour?

Thanks, Paul

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...