RE: Validating Checkboxes

2001-02-23 Thread bflynn

I always use ifDefined("form.checkbox") to see if the box was checked.
Using CFParam seems (very slightly) more error prone to me.  

Brian

-Original Message-
From: Roque,Carlos [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 5:45 PM
To: CF-Talk
Subject: RE: Validating Checkboxes


I am trying to pass a value if when a box is selected. Right now I use a
CFPARAM default ="". On submit it looks like it does something even though
it really does not.

Carlos Roque
I.S., WebMaster
x2154

 -Original Message-
From:   Phoeun Pha [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, February 21, 2001 11:07 AM
To: CF-Talk
Subject:    RE: Validating Checkboxes

what kind of validation?  please explain

-Original Message-
From: Roque,Carlos [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:18 AM
To: CF-Talk
Subject: Validating Checkboxes


Anyone have a good method in CF for validating checkboxes (grouped).


Carlos Roque
I.S., WebMaster
x2154
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Validating Checkboxes

2001-02-23 Thread alistair . davidson

I always use code like 

input type="checkbox" name="TheCheckbox" value="1"

and in the processing page

cfparam name="TheCheckbox" default=0

and I've never had any problems with it. Mind you, I haven't tested any
sites with Nutscrape 6 yet...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 23 February 2001 14:19
To: CF-Talk
Subject: RE: Validating Checkboxes


I always use ifDefined("form.checkbox") to see if the box was checked.
Using CFParam seems (very slightly) more error prone to me.  

Brian

-Original Message-
From: Roque,Carlos [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 5:45 PM
To: CF-Talk
Subject: RE: Validating Checkboxes


I am trying to pass a value if when a box is selected. Right now I use a
CFPARAM default ="". On submit it looks like it does something even though
it really does not.

Carlos Roque
I.S., WebMaster
x2154

 -Original Message-
From:   Phoeun Pha [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, February 21, 2001 11:07 AM
To: CF-Talk
Subject:RE: Validating Checkboxes

what kind of validation?  please explain

-Original Message-
From: Roque,Carlos [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:18 AM
To: CF-Talk
Subject: Validating Checkboxes


Anyone have a good method in CF for validating checkboxes (grouped).


Carlos Roque
I.S., WebMaster
x2154
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Validating Checkboxes

2001-02-23 Thread Stephen Kellogg

The value is held in the value= portion of the cfinput tag and can be
referenced after a submit as form.name where name is the name= portion of
the cfinput tag.

cfinput checked=#chk# type="Checkbox" NAME="location"
VALUE=#intLocationID# #strLocationName#, #strStateAbvrIDFK#

If you have several dynamically generated checkboxes (which sounds more like
what you were asking) and you want a quick check you can do the following.

May be more useful on a validation page
cfif listLen(location) eq 0
code here (i.e. tell the user they must check at least one check box)
cfelse
other code (process the boxes that were checked)
/cfif

or you can use this (more likely on a processing page)

cfif #IsDefined("form.location")#
cfloop index="LName" list=#form.location#
processing code here
/cfloop
/cfif

You could set the value initially to "no" with a cfparam then if the
checkbox gets checked, the value will get changed to the value in the
cfinput tag but given the above examples, this seems like a waste of time.

Not sure exactly what you're looking for, if none of the responses you've
gotten so far have helped, rephrase your question and give an example / some
code. If you get your answer, post a thanks so people won't keep trying to
answer. An example / code may lead to other options like radio buttons etc.

HTH

Stephen

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 9:19 AM
To: CF-Talk
Subject: RE: Validating Checkboxes


I always use ifDefined("form.checkbox") to see if the box was checked.
Using CFParam seems (very slightly) more error prone to me.

Brian

-Original Message-
From: Roque,Carlos [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 5:45 PM
To: CF-Talk
Subject: RE: Validating Checkboxes


I am trying to pass a value if when a box is selected. Right now I use a
CFPARAM default ="". On submit it looks like it does something even though
it really does not.

Carlos Roque
I.S., WebMaster
x2154

 -Original Message-
From:   Phoeun Pha [mailto:[EMAIL PROTECTED]]
Sent:   Wednesday, February 21, 2001 11:07 AM
To: CF-Talk
Subject:RE: Validating Checkboxes

what kind of validation?  please explain

-Original Message-
From: Roque,Carlos [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:18 AM
To: CF-Talk
Subject: Validating Checkboxes


Anyone have a good method in CF for validating checkboxes (grouped).


Carlos Roque
I.S., WebMaster
x2154
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Validating Checkboxes

2001-02-22 Thread Roque,Carlos

I am trying to pass a value if when a box is selected. Right now I use a
CFPARAM default ="". On submit it looks like it does something even though
it really does not.

Carlos Roque
I.S., WebMaster
x2154

 -Original Message-
From:   Phoeun Pha [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, February 21, 2001 11:07 AM
To: CF-Talk
Subject:    RE: Validating Checkboxes

what kind of validation?  please explain

-Original Message-
From: Roque,Carlos [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:18 AM
To: CF-Talk
Subject: Validating Checkboxes


Anyone have a good method in CF for validating checkboxes (grouped).


Carlos Roque
I.S., WebMaster
x2154
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Validating Checkboxes

2001-02-22 Thread Scott, Andrew

You might need to post the snippet of code for the submit and action
pages... Radio and Checkboxes if nothing is selected do not get passed back
to the server.

cfparam name="Checkbox_Name" default="" will only set it up as null if its
not already set up. But as for validation, what do you mean by this. Do you
mean validate that it exists, validate the data or something completely
different:-)



-Original Message-
From: Roque,Carlos [mailto:[EMAIL PROTECTED]]
Sent: 23 February 2001 09:45
To: CF-Talk
Subject: RE: Validating Checkboxes


I am trying to pass a value if when a box is selected. Right now I use a
CFPARAM default ="". On submit it looks like it does something even though
it really does not.

Carlos Roque
I.S., WebMaster
x2154

 -Original Message-
From:   Phoeun Pha [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, February 21, 2001 11:07 AM
To:     CF-Talk
Subject:    RE: Validating Checkboxes

what kind of validation?  please explain

-Original Message-
From: Roque,Carlos [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:18 AM
To: CF-Talk
Subject: Validating Checkboxes


Anyone have a good method in CF for validating checkboxes (grouped).


Carlos Roque
I.S., WebMaster
x2154
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Validating Checkboxes

2001-02-21 Thread Phoeun Pha

what kind of validation?  please explain

-Original Message-
From: Roque,Carlos [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:18 AM
To: CF-Talk
Subject: Validating Checkboxes


Anyone have a good method in CF for validating checkboxes (grouped).


Carlos Roque
I.S., WebMaster
x2154
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Validating Checkboxes

2001-02-21 Thread sebastian palmigiani

on 2/21/01 1:07 PM, Phoeun Pha at [EMAIL PROTECTED] wrote:

 Anyone have a good method in CF for validating checkboxes (grouped).

Since the form gives you a comma delimited list of values of the boxes
checked I would test with ListContains(variableName, variableValue).

Sebastian


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Validating Checkboxes

2001-02-21 Thread Lord, Heath

Bad news using ListContains...
because
this list contains 3

103,33,13,23,53

do a ListFind.. 3 will not be found in this list.

103,33,13,23,53

Heath

-Original Message-
From: sebastian palmigiani [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 2:38 PM
To: CF-Talk
Subject: Re: Validating Checkboxes


on 2/21/01 1:07 PM, Phoeun Pha at [EMAIL PROTECTED] wrote:

 Anyone have a good method in CF for validating checkboxes (grouped).

Since the form gives you a comma delimited list of values of the boxes
checked I would test with ListContains(variableName, variableValue).

Sebastian
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists