Selecting a Radio Button in a Flash Form

Posted on Sep 23, 2005

A colleague of mine was trying to figure out how you could select a radio button based upon a value returned by Flash Remoting in a CF Flash form. The answer turned out to be fairly simple it seems. You can select a radio button in a group based upon its value. Here is a vary simple form to show illustrate this:

<cfsavecontent variable="action">
   _root.r1.selectedData = 5;
</cfsavecontent>

<cfform format="flash" name="form1">
   <cfinput type="radio" name="r1" label="Radio 1" value="1">
   <cfinput type="radio" name="r1" label="Radio 2" value="2">
   <cfinput type="radio" name="r1" label="Radio 3" value="5">
   <cfinput type="button" name="button1" value="Click Me" onclick="#action#">
</cfform>

All this does is select the radio element with the value of 5 when you click the button. You can change the value and see that it will change which element it selects. So, to use this with Flash Remoting it should be as simple as saying selectedData equal to the value returned by your remoting call (my colleague is testing that out...if it isn't that easy, I will add an update).

Comments

Simeon I posted an entry about the remoting half of this over on my blog.

http://simb.net/index.cfm?do=blog.entry&amp;entry=831E18FB-F4C8-4EEA-29B150E4AF477962

Posted By Simeon / Posted on 09/23/2005 at 11:52 AM


Write your comment



(it will not be displayed)





About

My name is Brian Rinaldi and I am the Web Community Manager for Flash Platform at Adobe. I am a regular blogger, speaker and author. I also founded RIA Unleashed conference in Boston. The views expressed on this site are my own & not those of my employer.