Just wondering if there is an Easier way of doing these things.
By default I submit all text fields to the DB:
dbvalue = '#lcase(form.field)#'
then with CSS Style my outputs as
span style=text-transform:capitalize#dbvalue#/span
for fields Like Name or Address...
Is this the best way to be
Personally, I would put the values into proper case before putting them into
the database. That means you only have to process the text once... Not once
for each time you read it from the database.
...
Ben Nadel
www.bennadel.com
-Original Message-
From: Richard
Try using CapFirst() from cflib.org, works great, though you will still have
to write a regex for things like McMillan.
Thanks,
Mark
-Original Message-
From: Richard Dillman [mailto:[EMAIL PROTECTED]
Sent: Monday, August 07, 2006 5:14 PM
To: CF-Talk
Subject: Proper Case
Just wondering
If you want to change the case of all the elements in the form
structure, you could loop of them like so:
cfloop list=#structKeyList(form)# index=field
cfset form[field] = ucase(form[field])/
/cfloop
Or, you could loop over a subset of field names just to modify the
ones you want to
Joe I like your idea Ben mentioned Converting to Proper before Updating the
DB
SO:
cfloop list=#structKeyList(form)# index=field
cfset form[field] = CapFirst(Lcase(form[field]))/
/cfloop
This works great. Using Lower case becuase CapFirst converts to upper but
doesnt check for case in
Does anyone have a handy CF Proper Case UDF they would like to share?I was
going to write one but thought I would check the web (without success) and a
few discussion forums first.
Basically, my application sometimes has users entering in data in ALL CAPS.
DON'T YOU HATE IT WHEN THEY DO THAT?!!So
www.cflib.orgthat's where I've found it in the past
Bryan Stevenson B.Comm.
VP Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]
- Original Message -
From: Wes
To: CF-Talk
Sent: Tuesday, July 20, 2004 2:10 PM
Subject: Proper Case
PM
To: CF-Talk
Subject: Proper Case UDF
Does anyone have a handy CF Proper Case UDF they would like
to share?I was
going to write one but thought I would check the web (without
success) and a
few discussion forums first.
Basically, my application sometimes has users entering
have you looked at www.cflib.org?hard to believe there's nothing there
that would fit your needs (?)
- Original Message -
From: Wes [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Tuesday, July 20, 2004 2:10 PM
Subject: Proper Case UDF
Does anyone have a handy CF Proper Case UDF
Does anyone have a handy CF Proper Case UDF they would like to share?I was
going to write one but thought I would check the web (without success) and a
few discussion forums first.
CFLib has one for title case (actually it title cases a list of elements), maybe you could start
Supposing I am getting an output of a query. If the
company name in the database is :
THE GOOD COMPANY INC
How do I convert it to:
The Good Company Inc
Appreciate
AB
I don't suppose you're using an Oracle DB, are you? That's as simple as
"SELECT INITCAP(foo) FROM bar"...
Other than that, I
Supposing I am getting an output of a query. If the
company name in the database is :
THE GOOD COMPANY INC
How do I convert it to:
The Good Company Inc
Search the Allaire Developers Exchange for the cf_capitalize custom tag. It
has an attribute you can set to Titlecase and works like a
Supposing I am getting an output of a query. If the
company name in the database is :
THE GOOD COMPANY INC
How do I convert it to:
The Good Company Inc
Appreciate
AB
__
Do You Yahoo!?
Send online invitations with Yahoo! Invites.
13 matches
Mail list logo