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:265384
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