Re: Checkbox validation

2007-10-12 Thread Rick Root
So it IS parsing the CFML.

I was confused because you said :

   " tried the list, but the tags also appeared in the output"

I think Charlie's got your answer.

Rick

On 10/12/07, Steve LaBadie <[EMAIL PROTECTED]> wrote:
> It's not parsing, the page is .cfm document.  If a person choose all
> options it displays like this session1session2session3session4session5
>
> The whole site is coldfusion, all other apps are working fine. I even
> tried using the delimiter="," attribute in the cfloop.
>
> Steve LaBadie, Web Manager
> East Stroudsburg University
> 200 Prospect St.
> East Stroudsburg, Pa 18301
> 570-422-3999
> [EMAIL PROTECTED]
> http://www.esu.edu
>
> -Original Message-
> From: Rick Root [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 12, 2007 2:14 PM
> To: CF-Talk
> Subject: Re: Checkbox validation
>
> You mean your output isn't parsing the CFML code?
>
> Either coldfusion isn't installed, or isn't installed properly, or
> you're not executing a file that coldfusion parses (ie, you've got
> CFML code on an .htm or .html file)
>
> Rick
>
> On 10/12/07, Steve LaBadie <[EMAIL PROTECTED]> wrote:
> > I have created a form with checkboxes (the person can make multiple
> > choices).
> >
> >
> >
> > Adult/Teen Classes:
> >
> >  Session 1:
> >
> >  Session2:
> >
> >  Session 3:
> >
> >  Session 4:
> >
> >  Session 5:
> >
> >
> >
> > On the action page a created a loop to capture the responses; If the
> > person makes multiple choices I would like them separated either by
> > comas or  displayed in a list
> >
> >
> >
> > Adult/Teen Classes:  index="a">#a#
> >
> >
> >
> > I tried the list, but the tags also appeared in the output
> >
> >
> >
> > Adult/Teen Classes:  > index="a">#a#
> >
> >
> >
> >
> >
> >
> >
> > Steve LaBadie, Web Manager
> > East Stroudsburg University
> > 200 Prospect St.
> > East Stroudsburg, Pa 18301
> > 570-422-3999
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > http://www.esu.edu <http://www3.esu.edu>
> >
> >
> >
> >
> >
> >
>
>
>
> 

~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290987
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Checkbox validation

2007-10-12 Thread Robert Harrison
It's because check boxes need separate names. It's the HTML form, not CF. If
you want multi-select use a multi-select combo box (which will give you a
delimited string) ...

OR

if you need checkboxes give them different names. If the check boxes are
output from a query and you don't know the number, then add a count number
to the name to make then unique. Then, when you process, loop on them and
use EVALUATE to extract the values.

If you don't understand this contact me off list and I'll send you a routine
that will do it... but it's two sides - the build side and the process side.



Robert B. Harrison
Director of Interactive services
Austin & Williams
125 Kennedy Drive, Suite 100 Hauppauge NY 11788
T : 631.231.6600 Ext. 119 
F : 631.434.7022
www.austin-williams.com

Great advertising can't be either/or... It must be &.




~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290980
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Checkbox validation

2007-10-12 Thread Charlie Griefer
On 10/12/07, Steve LaBadie <[EMAIL PROTECTED]> wrote:
> It's not parsing, the page is .cfm document.  If a person choose all
> options it displays like this session1session2session3session4session5
>
> The whole site is coldfusion, all other apps are working fine. I even
> tried using the delimiter="," attribute in the cfloop.

That's exactly what you're telling it to output.  you're looping over
a list, outputting each element (and in your output, you're not
putting a comma).

you'd need to do:

#a#, (which would
leave a trailing comma, so you'd have to do a conditional inside the
loop to determine whether or not to show the comma).

of course, if you want to output the list, you could just do:

#form.adults#

:)

-- 
Charlie Griefer


"...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed."

~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290978
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Checkbox validation

2007-10-12 Thread Steve LaBadie
It's not parsing, the page is .cfm document.  If a person choose all
options it displays like this session1session2session3session4session5

The whole site is coldfusion, all other apps are working fine. I even
tried using the delimiter="," attribute in the cfloop.

Steve LaBadie, Web Manager
East Stroudsburg University
200 Prospect St.
East Stroudsburg, Pa 18301
570-422-3999
[EMAIL PROTECTED]
http://www.esu.edu

-Original Message-
From: Rick Root [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 12, 2007 2:14 PM
To: CF-Talk
Subject: Re: Checkbox validation

You mean your output isn't parsing the CFML code?

Either coldfusion isn't installed, or isn't installed properly, or
you're not executing a file that coldfusion parses (ie, you've got
CFML code on an .htm or .html file)

Rick

On 10/12/07, Steve LaBadie <[EMAIL PROTECTED]> wrote:
> I have created a form with checkboxes (the person can make multiple
> choices).
>
>
>
> Adult/Teen Classes:
>
>  Session 1:
>
>  Session2:
>
>  Session 3:
>
>  Session 4:
>
>  Session 5:
>
>
>
> On the action page a created a loop to capture the responses; If the
> person makes multiple choices I would like them separated either by
> comas or  displayed in a list
>
>
>
> Adult/Teen Classes: #a#
>
>
>
> I tried the list, but the tags also appeared in the output
>
>
>
> Adult/Teen Classes:  index="a">#a#
>
>
>
>
>
>
>
> Steve LaBadie, Web Manager
> East Stroudsburg University
> 200 Prospect St.
> East Stroudsburg, Pa 18301
> 570-422-3999
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> http://www.esu.edu <http://www3.esu.edu>
>
>
>
>
>
> 



~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290976
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Checkbox validation

2007-10-12 Thread Rick Root
You mean your output isn't parsing the CFML code?

Either coldfusion isn't installed, or isn't installed properly, or
you're not executing a file that coldfusion parses (ie, you've got
CFML code on an .htm or .html file)

Rick

On 10/12/07, Steve LaBadie <[EMAIL PROTECTED]> wrote:
> I have created a form with checkboxes (the person can make multiple
> choices).
>
>
>
> Adult/Teen Classes:
>
>  Session 1:
>
>  Session2:
>
>  Session 3:
>
>  Session 4:
>
>  Session 5:
>
>
>
> On the action page a created a loop to capture the responses; If the
> person makes multiple choices I would like them separated either by
> comas or  displayed in a list
>
>
>
> Adult/Teen Classes: #a#
>
>
>
> I tried the list, but the tags also appeared in the output
>
>
>
> Adult/Teen Classes:  index="a">#a#
>
>
>
>
>
>
>
> Steve LaBadie, Web Manager
> East Stroudsburg University
> 200 Prospect St.
> East Stroudsburg, Pa 18301
> 570-422-3999
> [EMAIL PROTECTED] 
> http://www.esu.edu 
>
>
>
>
>
> 

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290972
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: checkbox validation problem

2005-07-22 Thread Larry Lyons
>
>That's right! I didn't even notice the single checkbox part of this. If you
>look at the length of the checkbox array and get undefined, you only have
>one checkbox, so there's no need to bother with separate scripts. I think
>this would work for you:
>
>function checkForNoSelections() {
>   var e = document.viewItems;
>   if (!e.atccNum.length && e.attcNum.checked) {
>   return true;
>   }
>   for (var i = 0; i < e.atccNum.length; i++) {
>   if (e.attcNum[i].checked) {
>   return true;
>   }
>   }
>   alert('You must select an item to display.');
>   return false;
>}
>
>Dave Watts, CTO, Fig Leaf Software

Hi Dave,

The script worked just fine. 

Many thanks,

larry

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212516
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: checkbox validation problem

2005-07-21 Thread Dan G. Switzer, II
>> JavaScript treat multiple checkboxes as an array, but a single
>> checkbox is not an array. A quick goggle didn't turn me a up
>> with an example but there should be plenty of examples out
>> there of checking for this with JS.
>>
>> You can also take what I consider to be an easier way out,
>> using CF to push down a different script depending on how many
>> boxes you are going to have.
>
>That's right! I didn't even notice the single checkbox part of this. If you
>look at the length of the checkbox array and get undefined, you only have
>one checkbox, so there's no need to bother with separate scripts. I think
>this would work for you:

That's one of the nice things about the qForms API--you don't have to worry
about how the DOM works, you just code your rules. For example, if you want
to make sure at least one checkbox is filled in, just do:

oForm = new qForm("viewItems");
oForm.atccNum.required = true;

- or -

oForm = new qForm("viewItems");
oForm.required("atccNum");

The required() method allows you to specify a list of form fields to
require.

If you want to see the value of the checkboxes, just do:

oForm.atccNum.getValue();

The cool thing is, that's the same syntax you use to retrieve the value of
any form field!

More on qForms:
http://www.pengoworks.com/qforms/

-Dan



~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212468
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: checkbox validation problem

2005-07-21 Thread Larry Lyons
Thanks Dave. I'm at home right now, but I'll give it a try in the morning.

larry


>That's right! I didn't even notice the single checkbox part of this. If you
>look at the length of the checkbox array and get undefined, you only have
>one checkbox, so there's no need to bother with separate scripts. I think
>this would work for you:
>
>function checkForNoSelections() {
>   var e = document.viewItems;
>   if (!e.atccNum.length && e.attcNum.checked) {
>   return true;
>   }
>   for (var i = 0; i < e.atccNum.length; i++) {
>   if (e.attcNum[i].checked) {
>   return true;
>   }
>   }
>   alert('You must select an item to display.');
>   return false;
>}
>
>Dave Watts, CTO, Fig Leaf Software
>http://www.figleaf.com/
>
>Fig Leaf Software provides the highest caliber vendor-authorized 
>instruction at our training centers in Washington DC, Atlanta, 
>Chicago, Baltimore, Northern Virginia, or on-site at your location. 
>Visit http://training.figleaf.com/ for more information!

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212466
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: checkbox validation problem

2005-07-21 Thread Dave Watts
> JavaScript treat multiple checkboxes as an array, but a single 
> checkbox is not an array. A quick goggle didn't turn me a up 
> with an example but there should be plenty of examples out 
> there of checking for this with JS.
> 
> You can also take what I consider to be an easier way out, 
> using CF to push down a different script depending on how many 
> boxes you are going to have.

That's right! I didn't even notice the single checkbox part of this. If you
look at the length of the checkbox array and get undefined, you only have
one checkbox, so there's no need to bother with separate scripts. I think
this would work for you:

function checkForNoSelections() {
var e = document.viewItems;
if (!e.atccNum.length && e.attcNum.checked) {
return true;
}
for (var i = 0; i < e.atccNum.length; i++) {
if (e.attcNum[i].checked) {
return true;
}
}
alert('You must select an item to display.');
return false;
}

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!


~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212464
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: checkbox validation problem

2005-07-21 Thread Patrick McGeehan
JavaScript treat multiple checkboxes as an array, but a single checkbox is
not an array.  A quick goggle didn't turn me a up with an example but there
should be plenty of examples out there of checking for this with JS.

You can also take what I consider to be an easier way out, using CF to push
down a different script depending on how many boxes you are going to have.

-Original Message-
From: Larry Lyons [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 21, 2005 4:08 PM
To: CF-Talk
Subject: SOT: checkbox validation problem


I'm having a problem with a javascript validation for a form with
multiple checkboxes with the same name.

The validation works just fine when there is more than one checkbox (as with
a results set with more than one item) however, if there is only one
checkbox, it always validates to false and craps out. Any suggestions would
be most appreciated.

thx,

larry


~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212462
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: checkbox validation problem

2005-07-21 Thread Dave Watts
> function checkForNoSelections(){
> 
>var chkd = 0;
>var e = document.viewItems;
> 
>for(var i = 0; i < e.atccNum.length; i++){
>if(e.atccNum[i].checked == true){
>chkd = ++chkd;
>}
>}
>if(chkd > 0){
>e.submit();
>return true;
>}
>else{
>alert("You must select an item to display.");
>return false;
>}
> }

That's a bit odd - you typically don't use the assignment and increment
operators together that way, since you really only need one or the other.

The statement

++chkd;

is the same as

chkd = chkd + 1;

in the specific code you have above.

I would use something like this instead:

function checkForNoSelections() {
var e = document.viewItems;
for (var i = 0; i < e.atccNum.length; i++) {
if (e.attcNum[i].checked) {
return true;
}
}
alert('You must select an item to display.');
return false;
}






Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212460
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54