Dawn,
If you are using MS SQL Server you can do the following in the query that
you are suing to read the database with (or in the stored proc). I face this
issue when I am writing a CSV file from a table.

select replace(firsName, ',' , ' ' ) AS firstName, replace(lasName, ',' , '
' ) AS lastName
from tblName

This will replace the comma with a space.
This works in MS SQL Server, I think it would work in other database but you
would need to give it a try if you are using something else.

Ahmed.







On 6/4/07, Seth Bienek <[EMAIL PROTECTED]> wrote:

Hi Dawn,

You can use #trim(listFirst(getUser.lastName, ","))# to seperate
everything to the left of the comma in the form value.

Take Care,

Seth Bienek

-----Original Message-----
From: "Green, Ms. Dawn" <[EMAIL PROTECTED]>
To: [email protected]
Sent: 6/4/2007 11:24 AM
Subject: [DFW CFUG] Comma in a text field

I have built an application that requires a user to register and log in
to the system. I use cflogin framework to log someone into the system.



The problem I have encountered is that some of the people are trying to
put a title in their name fields along with their names. For example.
FirstName = "Dawn" LastName = "Green, MSIS".  The problem is with the
LastName having the comma in it.  It inserts into the database just fine
which is a varchar field, but when the person goes to log into the
system and goes to the forceUserLogin page, I have the LastName as part
of the <cfloginuser> to use as a session variable. Here is what that
code looks like.



<cfloginuser

NAME = "#getUser.userid#, #getUser.firstname#, #getUser.lastname#,
#getUser.email#, #getUser.UsersAccessID#, #getUser.PartnerID#"

PASSWORD = "#form.userPassword#"

roles = "#getUser.AccessLevel#">



What happens is that the comma in the LastName is being seen and it is
putting "Green" in the LastName field then seeing the comma and putting
the "MSIS" in the email field.



I guess my question is... What can I do to prevent the user from putting
the comma in the cfinput field in the first place or is there some way I
can prevent it in the cfloginuser part of my code from reading the comma
in the database field?



HELP!



Thanks in advance for any help you can give me.



Dawn Green


[truncated by sender]

_______________________________________________
Reply to DFWCFUG:
[email protected]
Subscribe/Unsubscribe:
http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
   http://www.mail-archive.com/list%40list.dfwcfug.org/
http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
www.instantspot.com/
www.teksystems.com/

_______________________________________________
Reply to DFWCFUG: 
  [email protected]
Subscribe/Unsubscribe: 
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives: 
    http://www.mail-archive.com/list%40list.dfwcfug.org/             
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors: 
  www.instantspot.com/
  www.teksystems.com/

Reply via email to