[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Submitted text via a form is being truncated if it contains a &

Posted on 2014-12-22
8
Medium Priority
?
93 Views
Last Modified: 2014-12-28
I have a website that using Coldfusion and it works fine. I have been trying to get the same website to work on a server running Unix and Railo. I have page that has a form with a textbox. When the form is submitted and the text contains an & I am finding that the submitted text is being truncated at the location of the &.

What do I do to be able to submit text that may contain a & (or any other characters that Railo has a problem with)?

Thank you
0
Comment
Question by:WestCoast_BC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 39

Expert Comment

by:gdemaria
ID: 40513142
Is the form being submitted with Method="Get"  or "Post" ?   I would think this would not happen with Post.   Are you doing a <cfdump var="#form#">  very first thing on the post page to see what the values look like before being touched?
0
 

Author Comment

by:WestCoast_BC
ID: 40513450
Thanks, It is converted to &amp; but it is choking at the & character.  Method is post. I do have a cfdump on the page but it may not be first thing on the page. The dump is showing the text truncated. The form is being submitted via a Ajax.submit form call
0
 
LVL 9

Expert Comment

by:Trenton Knew
ID: 40513459
what about converting it to %26?
0
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 

Author Comment

by:WestCoast_BC
ID: 40513471
I will try converting it to %26
0
 

Author Comment

by:WestCoast_BC
ID: 40520525
My problem is only happening on a UNIX server when I submit the form using ColdFusion.Ajax.submitForm.  If I submit the form by having the user click on a button that is a Submit type then it works fine.

I hope this helps to figure out what I am doing wrong.
0
 
LVL 39

Accepted Solution

by:
gdemaria earned 2000 total points
ID: 40520696
Use a js function to escape the special characters.   Quick research shows this may do it for you...

      encodeURIComponent()
0
 

Author Comment

by:WestCoast_BC
ID: 40520699
I have just tried encodeURIComponent and I think it looks like it is solving my problem
0

Featured Post

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Suggested Courses
Course of the Month14 days, 19 hours left to enroll

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question