close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How do you use a Radio Group in a repeat region

Thread began 2/23/2010 7:48 pm by Jaffa | Last modified 7/02/2010 2:51 pm by Eric Mittman | 6504 views | 8 replies |

Jaffa

How do you use a Radio Group in a repeat region

All records in this table has the value of Enabled=Yes. But when you insert the radio groups into repeat region the radio group is treated as One for all records.

I have asigned the dynamic value to the group to pickup the value for the list but it only shows the correct entry for the last record obviously becuate there can only be 21 state for the radio group.

How do I have each record show it's own value??

Thanks

Sign in to reply to this post

Jaffa

bump please i need an answer to this, Support is so slow

Sign in to reply to this post

Jason ByrnesWebAssist

Support is available between the hours of 9am - 5pm PST (GMT - 8)Monday through Friday. Outside of those times you can not expect to get a response from us. It is currently 11am PST.

Please see the following post details regarding our support Hours and Policy:
showthread.php?t=4214

the first step is to set the value of the radio button to come from your recordset.

Next, in the property inspector, click the Dynamic button. Click the lightning bolt next to Select value Equal To, and select the same recordset column that is being used for the value.


Here is an example of how the radio group is created suing a recordset:

php:
<?php do { ?>

      <input <?php if (!(strcmp($row_Recordset1['ProductID'],"<?php echo $row_Recordset1['ProductID']; ?>"))) {echo "checked=\"checked\"";} ?> type="radio" name="radio" id="radio_<?php echo $row_Recordset1['ProductID']; ?>" value="<?php echo $row_Recordset1['ProductID']; ?>" />
      <?php } while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?>
Sign in to reply to this post

Jaffa

Yes I know how to set a dynamic value from the database but in my example you will see unless you select the entire form within the repeat region all radio groups will be treated as one BIG group rather than individual groups for each record.

Trying to use mutiple update you cannot select the entire form only the <tr> tag so basically using a radio group with muliple record update is not an option.

or am I still overlooking something

Sign in to reply to this post

Dave BuchholzBeta Tester

You can use a radio group within multiple update, I do so all the time. This is a typical piece of code:

<?php do { ?>
<tr id="rowsort-<?php echo $row_rsMainView['id']; ?>">
<?php
// RepeatSelectionCounter_1 Begin Loop
$RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;
while($RepeatSelectionCounter_1_IterationsRemaining--){
if($RepeatSelectionCounterBasedLooping_1 || $row_rsMainView){
?>
<th class="textCenter"><?php echo $row_rsMainView['sortorder']; ?></th>
<td><input type="text" name="title_<?php echo $RepeatSelectionCounter_1; ?>" id="title_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_rsMainView['title']; ?>" size="30" /></td>
<td class="textCenter"><span class="radio">
<input<?php if (!(strcmp($row_rsMainView['publish'],"1"))) {echo " checked=\"checked\"";} ?> type="radio" name="publish_<?php echo $RepeatSelectionCounter_1; ?>" value="1" id="publish_0_<?php echo $RepeatSelectionCounter_1; ?>" />
<label for="publish_0_<?php echo $RepeatSelectionCounter_1; ?>">Yes</label>
<input<?php if (!(strcmp($row_rsMainView['publish'],"0"))) {echo " checked=\"checked\"";} ?> type="radio" name="publish_<?php echo $RepeatSelectionCounter_1; ?>" value="0" id="publish_1_<?php echo $RepeatSelectionCounter_1; ?>" />
<label for="publish_1_<?php echo $RepeatSelectionCounter_1; ?>">No</label>
</span>
<input type="hidden" name="tstampupdate_<?php echo $RepeatSelectionCounter_1; ?>" id="tstampupdate_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo time(); ?>" />
<input type="hidden" name="dateupdate_<?php echo $RepeatSelectionCounter_1; ?>" id="dateupdate_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo date('Y-m-d', time()); ?>" />
<input type="hidden" name="adminupdate_<?php echo $RepeatSelectionCounter_1; ?>" id="adminupdate_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $_SESSION['adminID']; ?>" /></td>
<td><?php echo $row_rsDeleteView['tstampinsert']?date('M jS, Y',$row_rsDeleteView['tstampinsert']):'No Date Logged'; ?></td>
<td><?php echo $row_rsDeleteView['tstampupdate']?date('M jS, Y',$row_rsDeleteView['tstampupdate']):'Never'; ?></td>
<td class="textCenter nowrap"><a class="i8_button" href="index.php?action=view&id=<?php echo $row_rsMainView['id']; ?>">View Details</a>
<input type="hidden" name="WADA_RepeatID_id_<?php echo $RepeatSelectionCounter_1; ?>" id="WADA_RepeatID_id_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_rsMainView["id"]; ?>" /></td>
<?php
} // RepeatSelectionCounter_1 Begin Alternate Content
else{
?>
<td colspan="5">No records match your request.</td>
<?php } // RepeatSelectionCounter_1 End Alternate Content
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
if(!$row_rsDetailView && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}
$row_rsDetailView = mysql_fetch_assoc($rsDetailView);
}
$RepeatSelectionCounter_1++;
} // RepeatSelectionCounter_1 End Loop
?>
</tr>



please bear in mind that I do not use the DA wizard to create my tables so they may look different to what you are used to seeing

Sign in to reply to this post

pinkiguana

using Radio Group in a repeat region

I am having the same issue, but I am using asp classic. When I choose the radio button to change the value (yes or no) for each row, I can only choose this for one row, it acts as if all the radio buttons in all the rows are just one.
Can someone post code on how to use the multiple update using radio button groups in the repeat region?

Sign in to reply to this post

Eric Mittman

So you have a radio group in a repeat region and updating it for one record changes this value for all of the other records as well? When you are on the page do you see all of the radio buttons change to the same value? Please post back with some more info about what you are experiencing, a link or some screen shots would be most helpful. Along with this please also post a copy of your page so we can take a look at how it is setup.

Sign in to reply to this post

pinkiguana

Using radio group in a repeat region

This is correct, but the update is not working anyway.
in the web page you see 25 rows of questions, each with its own radio button group of yes or no option. If you click yes on the first row, then no on the second, this action unselects the yes of the first row. The radio group behaves as through all the 25 instances are one group rather than 25 groups.

Sign in to reply to this post

Eric Mittman

Please also post a copy of your page in a zip archive so we can take a look at how it is setup.

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