That is a good site. I found another useful tag for two selects related for
Flash Forms.
Anyway, back to my checkbox issue. I found that I can make it so that if I
check one checkbox, I can check others using some action script in the Value
attribute of the CFINPUT. However, what I want to do is, if the user checks
box two and/or three, box on is unchecked. If box one is checked, then box's
two and three are unchecked. So far I have this:
<cfinput type="checkbox" name="checkbox1" value="{checkbox2.selected}"
label="Opt-Out" checked="yes">
<cfinput type="checkbox" name="checkbox2"
label="NASCAR Promotions">
<cfinput type="checkbox" name="checkbox3"
label="NASCAR Partner Promotions">
Of course if I check box two, then box one gets selected so this will not
work. So, how can I get it to work like I want? Sorry for appearing stupid
but I am new to action script.
Thanks,
Bruce
-----Original Message-----
From: Jacob Munson [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 30, 2006 7:39 AM
To: CF-Talk
Subject: Re: JavaScript not working with CFFOFM Checkbox
I've just barely started using Flash forms this month, and I had to jump
through some real hoops to get JS to work with them. It doesn't work like
normal, because the form elements are in a swf, they aren't accessible to
the page like normal form elements. But if you do some googling for using
javascript with flash forms, you'll probably find the same site I found
which has a work around. But the best route would be to use ActionScript,
which is a LOT like JavaScript. Check out http://www.asfusion.com/ for a
lot of excellent action script examples.
On 12/30/06, Bruce Sorge <[EMAIL PROTECTED]> wrote:
>
> I have this piece of JavaScript <http://forums.devshed.com/> that works
> fine with a regular HTML form checkbox:
> <script language="javascript">
> <!-- Begin
> function checkChoice(field, i) {
> if (i == 0) { // "All" checkbox selected.
> if (field[0].checked == true) {
> for (i = 1; i < field.length; i++)
> field[i].checked = false;
> }
> }
> else { // A checkbox other than "Any" selected.
> if (field[i].checked == true) {
> field[0].checked = false;
> }
> }
> }
> // End -->
> //-->
> </script>
>
> What I have are three check boxes. If the user clicks on the second or
> third, then the first one is unchecked, and if they check on the first one
> then the other two are unchecked. It works fine with a standard HTML
> <http://forums.devshed.com/> checkbox, but when I use CFINPUT
> TYPE=Checkbox
> it the page does not even come up. If I remove the onClick events then I
> can see everything, but of course the checkboxes are not doing what they
> are
> supposed to. (I am using CFFORM Type=Flash.) Here is the checkbox code:
>
> <cfinput type="checkbox" label="I do not want to opt in." name="optin"
> id="Opt_In" value="1" checked="yes"
> onClick="checkChoice(document.ViewerInfo.optin, 0)" />
>
> <cfinput type="checkbox" label="I want to receive offers from NASCAR"
> id="Nascar_Emails" name="optin" value="2"
> onClick="checkChoice(document.ViewerInfo.optin, 1)" />
>
> <cfinput type="checkbox" label="I want to receive offers from NASCAR
> Partners" id="Partner_Emails" name="optin" value="3"
> onClick="checkChoice(document.ViewerInfo.optin, 2" />
>
> Does JS not work in CFFORM? From what I am reading it should, other wise
> why
> have the events as an option?
>
> Thanks
>
> Bruce
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265393
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4