Solved

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

Posted on 2014-12-22
8
83 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
  • 4
  • 2
8 Comments
 
LVL 39

Expert Comment

by:gdemaria
Comment Utility
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
Comment Utility
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
Comment Utility
what about converting it to %26?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:WestCoast_BC
Comment Utility
I will try converting it to %26
0
 

Author Comment

by:WestCoast_BC
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
I have just tried encodeURIComponent and I think it looks like it is solving my problem
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now