Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested Quotes Problem 1

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
I am having a nested quotes problem with the value of an input text field. For example, how do I display the following string in a text field:

I don't want the "PTA" 38" model

How do you get that string to display as a part of:

<INPUT NAME=&quot;myField&quot; VALUE=&quot;??&quot;> Mise Le Meas,

Mighty :)
 
I don't want the &quot;PTA&quot; 38&quot; model --> <INPUT NAME=&quot;myField&quot; VALUE=&quot; I don\'t want the \&quot;PTA\&quot; 38\&quot; model &quot;> please check FAQ183-874 :)
 
iza,

That doesn't work.

This is the code that I was already using:

<INPUT NAME=&quot;comment&quot; SIZE=&quot;90&quot; MAXLENGTH=&quot;90&quot; VALUE=&quot;I don't want the \&quot;PTA\&quot; 38\&quot; model&quot; STYLE=&quot;font-family: Arial, Helvetica, Sans-Serif; font-size: 8pt&quot;>

The text that appears in the text field is:

I don't want the
I changed it to your format above with the forward slash before the single quote but that didn't work either. I have also tried to use double quotes (i.e. &quot;&quot;PTA&quot;&quot;) instead of \&quot; but none of it seems to work.

By the way, why did you direct me to FAQ183-874 Mise Le Meas,

Mighty :)
 
hmm IZA , that doesn't work for me.

If Iza's solution also doesnt work'for you Mighty, then try this:

value=&quot;I don& #39t want the & #34PTA& #34 38& #34 model&quot;>

Only leave the space between & and # , so code
&#..
Becuase if I leave it in this post then you'll see the character instead of the code.

Erik
 
dont bother Mighty, it is a signature; she directs everyone 2 this faq.. :) way 2 go! regards, vic
 
See also my last answer in thread215-98418 where you find the &quot;unicode&quot;-solution for the same problem in an alertbox

Erik
 
ErikL,

That worked a treat - I didn't need the & #39 as the single quote displays fine.

Vituz,

Thanks for the pointer - I was ready for a war of words!!! Mise Le Meas,

Mighty :)
 
Guys,

Along the same lines, how can I insert the same string into a database using an SQL command. It doesn't like the &#.. or the \u0027 codes. Any other ideas?? Mise Le Meas,

Mighty :)
 
Guys,

Along the same lines, how can I insert the same string into a database using an SQL command. The single quote is the problem this time. It doesn't seem to like the &#.. or the \u0027 codes. Any other ideas?? Mise Le Meas,

Mighty :)
 
To insert single quotes into a database, use whatever replace function you have to make all single quotes into two single quotes. Thanks
John

johnmc@mvmills.com
 
oracle : escape ' with ''
for example : &quot;don''t&quot;

various other plsql solutions :

SQL> show escape
escape OFF
SQL> set escape '/'
SQL> insert into t1(col1) values('valuewith/&')
SQL> select * from t1;
COL1
valuewith&

OR
set scan off
insert into t1(col1) values('valuewith&')

OR
change the variable substitution character to something else e.g.
set scan on
set define '~'
insert into t1(col1) values('valuewith&')


DO NOT READ THE SIGNATURE HERE vvvvv IT'S NOT FOR YOU ------
please review FAQ183-874 - this will help you to get the best out of tt
[ &quot;you&quot; is not someone in particular - don't take it too personnal ]
 
ooops, i realize you can read ''(2 single quote) as &quot; (1 double quote)
the solution i gave was to use 2 SINGLE quotes (the 1st one escapes the 2nd one) ------
please review FAQ183-874 - this will help you to get the best out of tt
[ &quot;you&quot; is not someone in particular - don't take it too personnal ]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top