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:265385
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to