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

x
?
Solved

Should be easy...

Posted on 2002-06-04
14
Medium Priority
?
173 Views
Last Modified: 2010-04-09
How do I get a double quote AND a single quote to appear as a value in a text field?  What I want is to have the string:
"Mrs. O'Connel"
appear in a text box.  (Oversimplification, but it gets across what I need.)  I've tried:
<input type="text" value='"Mrs. O''Connel"'>
but I just get "Mrs.O as a value.  How do I get the literals in there????

allie
0
Comment
Question by:allie
[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
  • 6
  • 3
  • 2
  • +3
14 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 200 total points
ID: 7054145
You have to escape the quotes and appostrophe this way:
<input type="text" value=' &#34;Mrs. O&#39;Connel&#34;'>


Cd&
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7054221
&#22; or %22 does not work with all browsers :-(

<input type=text value="O'Connel">
<input type=text value='O"Connel'>

but both mixed only if your browser supports HTML entitities in TAG attributes.
Probably you can do it with JavaScript ..
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 7054268
I got it to work with back-ticks in IE ... i don't know if this will work in all browsers:

value=`"O'Connel"`
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 18

Expert Comment

by:bruno
ID: 7054302
any way to do it XHTML compliant where the attribute is quoted propery?  

there should be, as that will soon be the standard...


BRUNO
0
 
LVL 2

Author Comment

by:allie
ID: 7054410
COBOLdinosaur and ahoffmann-

Excellent!  The "&#34" seems to be working!!  I'm a little concerned though about ahoffmann's comment that this may not work for all browsers... I'm using IE5, so which one's might it not work for?  If it's Netscape or IE6, that might be a problem.  If it's Opera or something like that I don't care as much... any info on how to find out what browsers use which escape codes??


Oh and BTW ahoffmann, I need to have both double and single quotes in the same field, so your example wouldn't work...  thanks though!

allie
0
 
LVL 2

Author Comment

by:allie
ID: 7054419
Oh yeah, also BTW, I saw in my HTML book that the escape sequence for the double quote (at least in URL encoding) is %22... but that didn't work at all here.  I had to use &#34 instead of &#22 or I didn't get the double quote (some other character appeared instead).  Wierd, but I thought I'd point it out...

allie
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7054900
I'm not sure which browsers will not support the escape characters.  

It is support by any browser that supports HTML3.2 or higher.

Specific browser support is:

IE since version 1
NS since version 1
opera since version 2.1

Based on references from WWw.blooberry.com.

I have not run across any browser that does not support the format, but there are a lot of fringe browsers around.

The complete list of support characters can be found at:
http://www.cwru.edu/hel/interHTML/examples/isolist0.html

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7054902
Oops.  Typo in the link it should be:

http://www.cwru.edu/help/interHTML/examples/isolist0.html

Cd&
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7055745
what happened to the good old days of the \ from the c++ legacy.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7055920
didn't dig deep (oops: nice acronym DDD) into the entitity problem, but know from experiance that following browsers do not what w3c recommends, or you expect:
   arachne, lynx, w3m, Netscape 4.x 6.x, Opera 4.x 5.x 6.x (not shure about 3.x), Konqueror 1.x 2.x, Mozilla 0.9.x

As I understand w3c docs, it's up to the browser how to implement these entitities in tag attributes, and that it is a CSS feature not HTML. But let me know if I missed some docs ;-)

I'm also suprised that some of the browsers behave strange (Netscape 6.x, Opera), but that's probably 'cause I only use "default" installations, and have not fiddled around with the browser's "user.css".

Hope this helps a bit.

BTW, didn't find a "Browser-Checks" list which have a check for this behaviour.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7056090
Support for major browsers show here.  A site which most who use it find very reliabel on cross-browser issues:

http://www.blooberry.com/indexdot/html/tagpages/c/charents.htm

Related Sites
Official References
http://www.rfc-editor.org/rfc/rfc1866.txt 
RFC 1866: The HTML 2.0 specification (plain text.) Appendix contains Character Entity table.
http://www.w3.org/MarkUp/html-spec/html-spec13.html 
The web version of the HTML 2.0 (RFC 1866) Character Entity table
http://www.w3.org/MarkUp/Wilbur/ 
The HTML 3.2 (Wilbur) recommendation
[This includes all character entities listed in HTML 2.0 plus new named entities covering the ISO 8859-1 120-191 range.]
http://www.w3.org/TR/REC-html40/ 
The HTML 4.0 Recommendation
[Includes new Unicode character entities]
http://www.w3.org/International/O-HTML.html 
The W3C HTML Internationalization area
http://unicode.org <http://www.unicode.org
The Unicode Consortium site

Other Related Links

http://www.ramsch.org/martin/uni/fmi-hp/iso8859-1.html 
Excellent resource with good pointers on ISO-8859 issues
http://ppewww.ph.gla.ac.uk/%7Eflavell/iso8859/iso8859-pointers.html
Alan Flavell's excellent document of pointers to information about ISO-8859
http://ppewww.ph.gla.ac.uk/%7Eflavell/iso8859/character-faq.txt
Alan Flavell's brief FAQ document regarding ISO-8859 issues in HTML
http://www.bbsinc.com/iso8859.html 
Kevin J Brewer's page with MANY links regarding character set issues.

Cd&

0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7056098
If you have seen it in Netscrap 6, then you are seeing a buggy version.  You might want to check bugzilla to see what is documented.  There were a lot of presentation problems associated with 6.  Tens of thousands of bug reports.

Cd&
0
 
LVL 2

Author Comment

by:allie
ID: 7056133
COBOLdinosaur-

You don't seem like a dinosaur to me!  ;)  Thanks for the help, and the links - now if someone comes back to me and says it doesn't work in their browser I can find out why!

Thanks everyone!

allie
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7056207
Glad we could help.  Thanks for the A. :^)

Cd&
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

656 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