Also, don't store 12", or 12" or 12in in the DB, store 12 and along
side it, in another column, an identifier for inches.

It'll make life easier when you need to query the info.

Adrian
Building a database of errors at http://cferror.org/

-----Original Message-----
From: s. isaac dealey
Sent: 12 October 2008 04:04
To: cf-talk
Subject: Re: How to handle quote symbols


> This is something i havent had to deal with before - might seem
> strange to you Americans, but I have to figure out how to handle a
> client who wants teh double quote symbol to represent inches.    He's
> a car parts retailer, and sells shock absorbers that are known to his
> market by inches not centimetres.     He doesnt want to represent a 12
> inch shock as  <quote> 12in throw</quote>  he wants to use the double
> quote symbol.

Sounds pretty normal on my end.

> However the quote symbol is seen by the form as teh end of the field
> when he wants to update his database on line, so the form has to be
> given 12&quot;   not 12".   I either have to make sure there are no
> double quote symbols in teh database, or put a replace() somewhere
> before the variable goes to the form html.

Right, you want
<input name="yadda" value="#htmleditformat(thevalue)#" />

> Here's my question.    do you store 12" in the database, or 12&quot;
>  Does it matter?

I would recommend not storing anyting with entities like &quot; in the
database, because there's no guarantee the data will always be used for
HTML. Maybe it will, maybe it won't. Maybe it'll go out in an email.
Maybe it'll go into a PDF. Maybe it'll go into an Excel spreadsheet.
Maybe it'll get sent to someone via a webservice. It's usually
impossible to know in advance really what formats it might potentially
be used in, so generally speaking I recommend storing the value with no
formatting and then applying the formatting when outputing or sending to
wherever you want it.

hth,
ike

--
s. isaac dealey  ^  new epoch
 isn't it time for a change?
     ph: 781.769.0723

http://onTap.riaforge.org/blog


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

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313784
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to