Ignore me... listen to Paul instead!

-----Original Message-----
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: 17 June 2008 13:44
To: CF-Newbie
Subject: RE: OT JavaScript help


The value never changes so checking that isn't what you're after.

Do this instead:

if (document.test.checkgroup[i].checked)
        alert("Bob is checked");

Adrian
http://www.adrianlynch.co.uk/

-----Original Message-----
From: Imperial, Robert [mailto:[EMAIL PROTECTED]
Sent: 17 June 2008 13:28
To: CF-Newbie
Subject: OT JavaScript help

Hello folks,

Trying to get my head around how to find a specific value of a checkbox
that has been checked here but I'm not getting it just yet. Below is
what I've been playing with trying to figure out the correct syntax to
pull this off. I only want to see if "bob" is checked then do some other
processing based on that. What I have here obviously doesn't work the
way I hoped it would as it pops the alert no matter which one is
checked. TIA

<form name="test" action="dump.cfm" onsubmit="return checkDaBoxes();">

<input type="checkbox" name="checkgroup" value="bob" />

<input type="checkbox" name="checkgroup" value="tom" />

<input type="checkbox" name="checkgroup" value="mary" />

<input type="submit" />

</form>

<script type="text/javascript">

function checkDaBoxes(){

for (i=0; i<document.test.checkgroup.length; i++){

if (document.test.checkgroup[i].value == 'bob')

alert("It's bob")

}

}

</script>

Bob



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3759
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to