CFSELECT (I hate CFFORM)

2005-07-15 Thread Stan Winchester
Are there any JavaScript errors? If so, try using FireFox's JS debugger. I have 
found CFFORM's JS sometimes will conflict with other JS that might be on the 
page. You could also just use a select tag and write your own JS to validate or 
use qForms as previously suggested.

Stan Winchester
Aftershock Web Design
http://www.aftershockweb.com/

Hi All,

I NEVER use CFFORM, but I've taken over  a site that does *sigh* ;-)

Any idea why this code would NOT throw a typical CFFORM JavaScript alert
when the user does not select anything?


~|
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:211969
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


CFSELECT (I hate CFFORM)

2005-07-14 Thread Phillip Molaro
You can do server side validation and it will catch the errors, BUT it does NOT 
pop up a javascript box like the inline required=yes feature does.  What it 
does is loads a blank page with a plain gray box and it has your message.  

What you have to do is to put in your select field, then add two hidden fields. 
 The name of each MUST match the name of your select box field. Then, to that 
name you append, _ and the command you want.  For this issue, your first 
field has _required added to the name, and for the second hidden field, you 
add _cfformnoblanks.  The noBlanks catches the first value, which is blank.

Note that in my code below, I have an error message in each hidden field (as 
the documentation states).  Both messages get displayed in the ugly gray box. 

Here is the code:

cfselect id=survey1 name=survey1 required=yes message=Please select a 
response for question one. validate=noblanks
 option value=Select.../option
 option value=Strongly Disagree1= Strongly Disagree/option
 option value=Disagree2= Disagree/option
 option value=Neutral3= Neutral/option
 option value=Agree4= Agree/option
 option value=Strongly Agree5= Strongly Agree/option
/cfselect

input type=hidden name=survey1_required value=You must answer.
input type=hidden name=survey1_cfformnoblanks value=Please select a 
response for question one.

I found all this stuff in the LiveDocs here:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentationfile=0161.htm

PS - I tried to be a hack and entered in  ' validate=noblanks ' into my 
cfselect tag hoping that would do the same thing, just tricking CF into writing 
the JS to have the pop up box.  Sadly, this does not work.

You can also use IsValid or CFPARAM as outlined on this page to make a custom 
solution:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentationfile=0161.htm

~|
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:211899
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: CFSELECT (I hate CFFORM)

2005-07-14 Thread Dan G. Switzer, II
Phillip,

If you don't like CFFORM, take a look at qForms:
http://www.pengoworks.com/qforms/

Here's an example of what you're trying to do done in qForms:
http://www.pengoworks.com/qforms/docs/examples/n-related_selectboxes.htm

The validation portion is actually all done w/the following code:
// initialize the qForm object
objForm = new qForm(frmExample);

// make these fields required
objForm.required(Sport,Division,Team);

The rest of the JS shows off how you can do n-Related selects.

-Dan

-Original Message-
From: Phillip Molaro [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 14, 2005 2:56 PM
To: CF-Talk
Subject: CFSELECT (I hate CFFORM)

You can do server side validation and it will catch the errors, BUT it does
NOT pop up a javascript box like the inline required=yes feature does.
What it does is loads a blank page with a plain gray box and it has your
message.

What you have to do is to put in your select field, then add two hidden
fields.  The name of each MUST match the name of your select box field.
Then, to that name you append, _ and the command you want.  For this
issue, your first field has _required added to the name, and for the
second hidden field, you add _cfformnoblanks.  The noBlanks catches the
first value, which is blank.

Note that in my code below, I have an error message in each hidden field
(as the documentation states).  Both messages get displayed in the ugly
gray box.

Here is the code:

cfselect id=survey1 name=survey1 required=yes message=Please select
a response for question one. validate=noblanks
 option value=Select.../option
 option value=Strongly Disagree1= Strongly Disagree/option
 option value=Disagree2= Disagree/option
 option value=Neutral3= Neutral/option
 option value=Agree4= Agree/option
 option value=Strongly Agree5= Strongly Agree/option
/cfselect

input type=hidden name=survey1_required value=You must answer.
input type=hidden name=survey1_cfformnoblanks value=Please select a
response for question one.

I found all this stuff in the LiveDocs here:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/
html/wwhelp.htm?context=ColdFusion_Documentationfile=0161.htm

PS - I tried to be a hack and entered in  ' validate=noblanks ' into my
cfselect tag hoping that would do the same thing, just tricking CF into
writing the JS to have the pop up box.  Sadly, this does not work.

You can also use IsValid or CFPARAM as outlined on this page to make a
custom solution:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/
html/wwhelp.htm?context=ColdFusion_Documentationfile=0161.htm



~|
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:211901
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: CFSELECT (I hate CFFORM)

2005-07-14 Thread Will Tomlinson
I've run into the same thing before. Incredibly aggravating! 

I just mark one as selected, then you know they can't get past it. 

Will

www.codefusiongear.com

~|
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:211904
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


CFSELECT (I hate CFFORM)

2005-07-14 Thread Phillip Molaro
I just found this posted by a user in the LiveDocs and it works great!

What you need to do is to edit the javascript that the CF server writes so that 
it also checks for a null value (your value= part of your first option item). 
This is a simple code change in a javascript template file.  Edit this file:

C:\CFusionMX7\wwwroot\CFIDE\scripts\cfform.js 

Inside this file, modify line #73 this way: 

ORIGINAL:
else if (obj_type == SELECT)
{
for (i=0; i  obj.length; i++)
{
if (obj.options[i].selected)
return true;
}
return false;
} 

MODIFIED:
else if (obj_type == SELECT)
{
for (i=0; i  obj.length; i++)
{
if (obj.options[i].selected  obj.options[i].value != )
return true;
}
return false;
} 

You may need to restart your coldfusion service, but otherwise this will work 
with the standard required=yes method in your cfselect tag.

Giving credit where credit is due:
http://livedocs.macromedia.com/coldfusion/5.0/CFML_Reference/Tags91.htm

~|
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:211915
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: CFSELECT (I hate CFFORM)

2005-07-14 Thread S . Isaac Dealey
I believe if you use format=xml you can fix the default behavior for
required select boxes by editing the XSL sheet. Although admittedly if
you're talking about an older form which already has an html table (or
other html markup) built around the input elements, then you have to
rewrite the whole form...

I don't care much for cfform myself -- even including the new features
in 7... I have my own tools for something similar to the XForms
implementation which are much more powerful. tap:form produces a
similar default layout for the form (like cfform format=xml) plus it
provides a lot of features that cfform doesn't, like automated values
and database integration.


s. isaac dealey   954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm




~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211920
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: CFSELECT (I hate CFFORM)

2003-03-27 Thread Bryan Stevenson
Actually Bud it doesn't work with no value attribute either (I tried it
every way possible).  Anyways, thanks for the responseI rolled a custom
solution to get around CFSELECT and it's dark dark evilness ;-)

Bryan Stevenson B.Comm.
VP  Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]

-
Macromedia Associate Partner
www.macromedia.com
-
Vancouver Island ColdFusion Users Group
Founder  Director
www.cfug-vancouverisland.com
- Original Message -
From: Bud [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 5:16 PM
Subject: Re: CFSELECT (I hate CFFORM)


 On 3/26/03, Bryan Stevenson penned:
 I'm using IE and I know IE would consider the text Select one as the
 selection when the option value is left blank as I'm doing.  I tried
 removing the Select one text and it still didn't catch the lack of
 selection!!

 It shouldn't. If it does it's broke. It should only recognize Select
 one if there was no value attribute at all.

 optionSelect one

 And cfselect isn't used that way. You pass a query to it. I believe
 the minimum is below:

 cfselect
 name=field name
 query=query name
 value=field to be passed as value
 display=field to display
 /cfselect

 You can also add required and message as with cfinput.

 That said, javascript validation has never worked on cfselect for me.
 I hate cfselect also. But I do use cfform quite a bit.
 --

 Bud Schneehagen - Tropical Web Creations

 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 ColdFusion Solutions / eCommerce Development
 [EMAIL PROTECTED]
 http://www.twcreations.com/
 http://www.cf-ezcart.com/
 954.721.3452
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: CFSELECT (I hate CFFORM)

2003-03-27 Thread ksuh
The required checking for cfselect for a size of 1 has never worked.  I wonder if they 
fixed it in CFMX.

And you can place option tags within cfselect/cfselect, in addition to or 
without a query.

- Original Message -
From: Bryan Stevenson [EMAIL PROTECTED]
Date: Thursday, March 27, 2003 9:27 am
Subject: Re: CFSELECT (I hate CFFORM)

 Actually Bud it doesn't work with no value attribute either (I 
 tried it
 every way possible).  Anyways, thanks for the responseI rolled 
 a custom
 solution to get around CFSELECT and it's dark dark evilness ;-)
 
 Bryan Stevenson B.Comm.
 VP  Director of E-Commerce Development
 Electric Edge Systems Group Inc.
 t. 250.920.8830
 e. [EMAIL PROTECTED]
 
 -
 Macromedia Associate Partner
 www.macromedia.com
 -
 Vancouver Island ColdFusion Users Group
 Founder  Director
 www.cfug-vancouverisland.com
 - Original Message -
 From: Bud [EMAIL PROTECTED]
 To: CF-Talk [EMAIL PROTECTED]
 Sent: Wednesday, March 26, 2003 5:16 PM
 Subject: Re: CFSELECT (I hate CFFORM)
 
 
  On 3/26/03, Bryan Stevenson penned:
  I'm using IE and I know IE would consider the text Select one 
 as the
  selection when the option value is left blank as I'm doing.  I 
 tried removing the Select one text and it still didn't catch 
 the lack of
  selection!!
 
  It shouldn't. If it does it's broke. It should only recognize Select
  one if there was no value attribute at all.
 
  optionSelect one
 
  And cfselect isn't used that way. You pass a query to it. I believe
  the minimum is below:
 
  cfselect
  name=field name
  query=query name
  value=field to be passed as value
  display=field to display
  /cfselect
 
  You can also add required and message as with cfinput.
 
  That said, javascript validation has never worked on cfselect 
 for me.
  I hate cfselect also. But I do use cfform quite a bit.
  --
 
  Bud Schneehagen - Tropical Web Creations
 
  _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  ColdFusion Solutions / eCommerce Development
  [EMAIL PROTECTED]
  http://www.twcreations.com/
  http://www.cf-ezcart.com/
  954.721.3452
  
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: CFSELECT (I hate CFFORM)

2003-03-27 Thread Bryan Stevenson
This is CFMX and no it doesn't work.grr ;-)

Bryan Stevenson B.Comm.
VP  Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]

-
Macromedia Associate Partner
www.macromedia.com
-
Vancouver Island ColdFusion Users Group
Founder  Director
www.cfug-vancouverisland.com
- Original Message -
From: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 9:00 AM
Subject: Re: CFSELECT (I hate CFFORM)


 The required checking for cfselect for a size of 1 has never worked.  I
wonder if they fixed it in CFMX.

 And you can place option tags within cfselect/cfselect, in addition
to or without a query.

 - Original Message -
 From: Bryan Stevenson [EMAIL PROTECTED]
 Date: Thursday, March 27, 2003 9:27 am
 Subject: Re: CFSELECT (I hate CFFORM)

  Actually Bud it doesn't work with no value attribute either (I
  tried it
  every way possible).  Anyways, thanks for the responseI rolled
  a custom
  solution to get around CFSELECT and it's dark dark evilness ;-)
 
  Bryan Stevenson B.Comm.
  VP  Director of E-Commerce Development
  Electric Edge Systems Group Inc.
  t. 250.920.8830
  e. [EMAIL PROTECTED]
 
  -
  Macromedia Associate Partner
  www.macromedia.com
  -
  Vancouver Island ColdFusion Users Group
  Founder  Director
  www.cfug-vancouverisland.com
  - Original Message -
  From: Bud [EMAIL PROTECTED]
  To: CF-Talk [EMAIL PROTECTED]
  Sent: Wednesday, March 26, 2003 5:16 PM
  Subject: Re: CFSELECT (I hate CFFORM)
 
 
   On 3/26/03, Bryan Stevenson penned:
   I'm using IE and I know IE would consider the text Select one
  as the
   selection when the option value is left blank as I'm doing.  I
  tried removing the Select one text and it still didn't catch
  the lack of
   selection!!
  
   It shouldn't. If it does it's broke. It should only recognize Select
   one if there was no value attribute at all.
  
   optionSelect one
  
   And cfselect isn't used that way. You pass a query to it. I believe
   the minimum is below:
  
   cfselect
   name=field name
   query=query name
   value=field to be passed as value
   display=field to display
   /cfselect
  
   You can also add required and message as with cfinput.
  
   That said, javascript validation has never worked on cfselect
  for me.
   I hate cfselect also. But I do use cfform quite a bit.
   --
  
   Bud Schneehagen - Tropical Web Creations
  
   _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
   ColdFusion Solutions / eCommerce Development
   [EMAIL PROTECTED]
   http://www.twcreations.com/
   http://www.cf-ezcart.com/
   954.721.3452
  
 
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



CFSELECT (I hate CFFORM)

2003-03-26 Thread Bryan Stevenson
Hi All,

I NEVER use CFFORM, but I've taken over  a site that does *sigh* ;-)

Any idea why this code would NOT throw a typical CFFORM JavaScript alert
when the user does not select anything?

cfselect name=sNewCountry message=Select a country required=Yes
   option value=Select one
   cfloop query=qCountryList
  option value=#coun_country_id# cfif sNewCountry eq
coun_country_idselected/cfif#coun_country_name#
   /cfloop
/cfselect

I'm using IE and I know IE would consider the text Select one as the
selection when the option value is left blank as I'm doing.  I tried
removing the Select one text and it still didn't catch the lack of
selection!!

Any thoughts??

TIA

Cheers

Bryan Stevenson B.Comm.
VP  Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]

-
Macromedia Associate Partner
www.macromedia.com
-
Vancouver Island ColdFusion Users Group
Founder  Director
www.cfug-vancouverisland.com

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: CFSELECT (I hate CFFORM)

2003-03-26 Thread Dave Watts
 I NEVER use CFFORM, but I've taken over a site that does 
 *sigh* ;-)
 
 Any idea why this code would NOT throw a typical CFFORM 
 JavaScript alert when the user does not select anything?
 
 cfselect name=sNewCountry message=Select a country 
 required=Yes
option value=Select one
cfloop query=qCountryList
   option value=#coun_country_id# cfif sNewCountry eq
 coun_country_idselected/cfif#coun_country_name#
/cfloop
 /cfselect
 
 I'm using IE and I know IE would consider the text Select 
 one as the selection when the option value is left blank 
 as I'm doing. I tried removing the Select one text and it 
 still didn't catch the lack of selection!!
 
 Any thoughts??

I've used CFFORM quite a bit, but I generally don't use CFSELECT.

My thought is that there is no lack of selection possible - this is a
regular single select box that only allows the user to select one option.
In that case, there will always be one option selected. It shouldn't matter
what the value or display text is for the selected option - it can still be
selected.

If your intent is to have some Javascript run if the user selects the first
option, you'll probably have to write that yourself.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: CFSELECT (I hate CFFORM)

2003-03-26 Thread Bud
On 3/26/03, Bryan Stevenson penned:
I'm using IE and I know IE would consider the text Select one as the
selection when the option value is left blank as I'm doing.  I tried
removing the Select one text and it still didn't catch the lack of
selection!!

It shouldn't. If it does it's broke. It should only recognize Select 
one if there was no value attribute at all.

optionSelect one

And cfselect isn't used that way. You pass a query to it. I believe 
the minimum is below:

cfselect
name=field name
query=query name
value=field to be passed as value
display=field to display
/cfselect

You can also add required and message as with cfinput.

That said, javascript validation has never worked on cfselect for me. 
I hate cfselect also. But I do use cfform quite a bit.
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
http://www.cf-ezcart.com/
954.721.3452
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4