EasyCFM.COM ColdFusion Forums / Coding Help! / Spaces in a text field

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Spaces in a text field

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

byondf1
11-05-2002 @ 3:34 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 4
Joined: Nov 2002

I am having a problem with an Intranet ColdFusion form. I am using the following:

<CFSET FileOutput = "#FileOutput#
    <tr>
     <td width=5%>
      <img src=/images/spacer.gif height=1 width=20><br>
     </td>
     <td width=95%>
      #Form.Idea#<br>
     </td>
    </tr>
">

The problem I am having is if the text in the #Form.Idea# field contains one or more "s it cuts off the text at the " mark.

Any ideas?

Thanx.


Greg A. Anderson - webmaster@byondf1.com
-
ByondF1.com Web Site & Graphic Design - http://www.byondf1.com
LDSircNet - http://www.ldsirc.net
Our Pledge of Allegiance store - http://www.cafeshops.com/Allegiance
Our LDSircNet store - http://www.ldsirc.n

Webmaster
11-05-2002 @ 4:13 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

I'm not sure I understand your post, please explain a bit more in detail what you're trying to achieve...

Thanks,
Pablo Varando
EasyCFM.COM, LLC.

byondf1
11-05-2002 @ 4:20 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 4
Joined: Nov 2002

I have a <textarea> field on a form. When someone enters anything in quotes in that field like: The person said "Hello" the part of the code posted above will only report that The person said was entered. Everything starting at the first " gets truncated.

Greg A. Anderson - webmaster@byondf1.com
-
ByondF1.com Web Site & Graphic Design - http://www.byondf1.com
LDSircNet - http://www.ldsirc.net
Our Pledge of Allegiance store - http://www.cafeshops.com/Allegiance
Our LDSircNet store - http://www.ldsirc.n

Webmaster
11-05-2002 @ 6:00 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

Try this then:

<textarea>#ReplaceNoCase(Form.Idea, '"', '', 'ALL')#</textarea>

See if that displays it correctly, if it does let me know and I'll modify one other thing for you!

Thanks,
Pablo Varando
EasyCFM.COM, LLC.

byondf1
11-05-2002 @ 6:19 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 4
Joined: Nov 2002

I think you are misunderstading. The problem isn't with the <textarea> tag. It is in the program that is getting the data from the tag. I send the data to another program that creates a form from the input and prints it to the screen as well as creating a static page from it. It is on that page that the data is being truncated.

Greg A. Anderson - webmaster@byondf1.com
-
ByondF1.com Web Site & Graphic Design - http://www.byondf1.com
LDSircNet - http://www.ldsirc.net
Our Pledge of Allegiance store - http://www.cafeshops.com/Allegiance
Our LDSircNet store - http://www.ldsirc.n

Webmaster
11-05-2002 @ 7:00 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

ok, then on the page you are displaying at replace the following:

<CFSET FileOutput = "#FileOutput#
    <tr>
     <td width=5%>
      <img src=/images/spacer.gif height=1 width=20><br>
     </td>
     <td width=95%>
      #Form.Idea#<br>
     </td>
    </tr>

With the following:
<CFSET FileOutput = "#FileOutput#
    <tr>
     <td width=5%>
      <img src=/images/spacer.gif height=1 width=20><br>
     </td>
     <td width=95%>
      #ReplaceNoCase(Form.Idea, '"', '', 'ALL')#<br>
     </td>
    </tr>


See if that works...

Thanks,
Pablo Varando
EasyCFM.COM, LLC.

byondf1
11-05-2002 @ 7:08 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 4
Joined: Nov 2002

Thanx. That is what I was thinking but did not know the format. I really appreciate the assistance. I will try it tomorrow.

Greg A. Anderson - webmaster@byondf1.com
-
ByondF1.com Web Site & Graphic Design - http://www.byondf1.com
LDSircNet - http://www.ldsirc.net
Our Pledge of Allegiance store - http://www.cafeshops.com/Allegiance
Our LDSircNet store - http://www.ldsirc.n

Webmaster
11-05-2002 @ 10:32 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

No problem, let me know if you need help with anything else...

Thanks,
Pablo Varando
EasyCFM.COM, LLC.


Website Designed and Developed by Pablo Varando.