• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

I need to replace "" in my form fields

Guest
Jul 18, 2007 Jul 18, 2007

Copy link to clipboard

Copied

Okay, let's say I'm using <cfform> and <cfinput> tags and I want to replace quotes with nothing if a user enters quotes in my named fields. How would I do that?

say i had a field name "firstname". If a user entered something like "John Doe" and kept the quotes in there, how would I replace the quotes with nothing at all?
TOPICS
Advanced techniques

Views

222

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 18, 2007 Jul 18, 2007

Copy link to clipboard

Copied

Look at the replace() function
http://livedocs.adobe.com/coldfusion/7/htmldocs/00000611.htm

Edit - Replace the character with an empty string "" (ie nothing at all)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 20, 2007 Jul 20, 2007

Copy link to clipboard

Copied

LATEST
While using replace function do not forget to specify the score as "ALL" to replace all the quotes.

If some single quote validations needed then see livedocs for PreserveSingleQuotes()

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation