The Artima Developer Community
Sponsored Link

Java Buzz Forum
CFML Tip; Passing large text around in hidden form variables

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Alan Williamson

Posts: 78
Nickname: awilliamso
Registered: Sep, 2004

Alan Williamson is chief architect of Blog-City and BlueDragon in addition to his online ramblings
CFML Tip; Passing large text around in hidden form variables Posted: Nov 24, 2004 5:13 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Alan Williamson.
Original Post: CFML Tip; Passing large text around in hidden form variables
Feed Title: Technical @ alan.blog-city.com
Feed URL: http://www.ibm.com/us/en/
Feed Description: (Technical) the rants of a java developer trapped in the body of a java developer!
Latest Java Buzz Posts
Latest Java Buzz Posts by Alan Williamson
Latest Posts From Technical @ alan.blog-city.com

Advertisement

Sometimes it is necessary to pass large blocks of text around in hidden input forms.  For example if you are developing a wizard type input or maybe you are passing data on through.  Complications arise when you need to pass blocks of text that may contain carriage returns, or weird characters that may through your form variable.

In CFML you can easily get around all this nasty encoding and decoding complications by Base64 encoding your text while inserting it into your hidden form variable.  For example:

<input type="hidden" name="hidden_body" value="#ToBase64(body)#">

It will be encoded as one long line of characters.  You can decode this at the other side of the page submission by unwrapping:

<cfset body = ToString( ToBinary( form.hidden_body ) )>

No more complicated search and replaces.

Read: CFML Tip; Passing large text around in hidden form variables

Topic: XML HTTP Request object (and named parameters) Previous Topic   Next Topic Topic: Bad Firefox!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use