close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Repeating Tables & Radio (group) buttons

Thread began 6/03/2015 4:15 pm by Paul | Last modified 6/04/2015 2:12 am by Paul | 421 views | 0 replies

PaulBeta Tester

Repeating Tables & Radio (group) buttons

I've created a repeating table that returns images belonging to a logged in user.

Each row features a check box and radio button which is used to select which images are active and the radio to assign a single image as the primary image. I'm using WA update multiple records to achieve this.

The checkboxes work fine, however the radio button is partially working. Unfortunately it is not allowing a single selection as you would expect in a radio group. They are behaving as checkboxes.

Heres the form code:

<form name="ManageUsrImgFrm" method="post" action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>" >

<table width="100%" border="1" cellspacing="2" cellpadding="2">
<th scope="col" width="180px">Thumbnail</th>
<th scope="col">Tag</th>
<th scope="col">Active</th>
<th scope="col">Amend</th>
<th scope="col">Delete</th>
<th scope="col">Primary</th>
<?php do { ?>
// RepeatSelectionCounter_1 Begin Loop
$RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;
if($RepeatSelectionCounterBasedLooping_1 || $row_rsGetUser){
<th scope="row"><?php
if(TRUE){ // Begin Cached Resized Image: ImageCacheInstance_1433274395061
<img name="ShowThumbnail" src="<?php echo $row_rsGetUser['PicImageFolder']; ?><?php echo $row_rsGetUser['PicImageName']; ?>" width="180" height="100" alt="">
echo(getCachedResizedImageHTML(ob_get_clean(), "../image_cache", "crop", "", false));
} // End Cached Resized Image: ImageCacheInstance_1433274395061
<td><input type="hidden" name="WADA_RepeatID_PicID_<?php echo $RepeatSelectionCounter_1; ?>" id="WADA_RepeatID_PicID_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_rsGetUser["PicID"]; ?>" />
<input <?php if (!(strcmp($row_rsGetUser['PicImageActive'],1))) {echo "checked=\"checked\"";} ?> name="UsrImgActive_<?php echo $RepeatSelectionCounter_1; ?>" type="checkbox" id="checkbox_<?php echo $RepeatSelectionCounter_1; ?>" value="1" ></td>
<td><input <?php if (!(strcmp($row_rsGetUser['PicImageMain'],"1"))) {echo "checked=\"checked\"";} ?> name="UsrImgPrime_<?php echo $RepeatSelectionCounter_1; ?>" type="radio" id="UsrImgPrime_<?php echo $RepeatSelectionCounter_1; ?>" value="1">
} // RepeatSelectionCounter_1 Begin Alternate Content
<td>No records match your request.</td>
<?php } // RepeatSelectionCounter_1 End Alternate Content
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
if(!$row_rsGetUser && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}
$row_rsGetUser = mysql_fetch_assoc($rsGetUser);
} // RepeatSelectionCounter_1 End Loop
<?php } while ($row_rsGetUser = mysql_fetch_assoc($rsGetUser)); ?>
<input name="BtnPrimeImg" type="submit" value="Update">
<input name="UsrImgPrimeDate" type="hidden">

A normal radio group share the same input name so only one can be selected, if i do the same here it behaves as a group but changes are not saved and returned when the page is refreshed.

Update: so i found this;

I've settled for using a second record update behaviour to post the selected value in. I can then call it through a recordset.
I seemed to have simplified the problem and solution!

Just need to tweak the following to return the selected option button when page is refreshed - it currently returns nothing!

<input <?php if (!(strcmp($row_rsGetUser['PicImagePrime'],1))) {echo "checked=\"checked\"";} ?> type="radio" id="UsrImgPrime_<?php echo $row_rsGetUser['PicID']; ?>" name="UsrImgPrime" value="<?php echo $row_rsGetUser['PicID']; ?>">

Any ideas anyone?

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





Ease of use


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...