Reply to Re: Hidden field value displaying when the text contains double quotes

Your name:

Reply:


Posted by John Hosking on 03/28/07 22:45

DennBen wrote:
>
> myVariable = '"Our values are the backbone of our business"<BR>"This
> set of quotes will break it"'
>
> <FORM ACTION="action.cfm?" METHOD="Post">
> <INPUT TYPE="Hidden" NAME="Mission" VALUE="#myVariable#">
> <input type="image" src="/images/buttons/btn_approve_profile.gif"
> width="121" height="19" value="submit" alt="Approve Profile"
> border="0">
> </FORM>

Well, this is one of the wildest guesses I've ever pulled out of my, um,
ear, but how about this: use the same delimiters for the parameter
(VALUE="") as in the variable definition (myVariable = ""), and *invert*
the quotes for the variable contents. Or vice-versa, since you want the
passed variable to include double quotes. I mean, try:

myVariable = '"Our values are the backbone of our business"<BR>"This
set of quotes will break it"'
and
<INPUT bla bla VALUE='#myVariable#'>

Then, when the variable's _value_, "Our values yadda hooey... break it"
get dropped into the VALUE parameter (delimited by single quotes)
there's no conflict; you end up with <INPUT bla bla VALUE='"Our values
yadda hooey... break it"'> and the form knows what you want. Does that
work for you?

--
John (offering triple-your-money back if the tip doesn't satisfy you!)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация