Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: commas, quotes, JavaScript, html, asp


Message #1 by "Graham Miles" <graham@v...> on Wed, 21 Aug 2002 11:02:19 +0100
As far as I know single quotes are not "standard" html....but the
browsers let you get away with it....

Use a double quote....and then when you need to write out the field name
use the ASP Replace() function

strString = Replace(Rs("fieldname"),"'","''")

replacing a single instance of a quote with 2 insances of the quote will
fix it for you.


-----Original Message-----
From: Graham Miles [mailto:graham@v...] 
Sent: Wednesday, August 21, 2002 9:56 AM
To: javascript
Subject: [javascript] RE: commas, quotes, JavaScript, html, asp

Thanks, simple but functional, that's what I like!


-----Original Message-----
From: Teng Fong SEAK [mailto:tfseak@f...]
Sent: 21 August 2002 11:09
To: javascript
Subject: [javascript] RE: commas, quotes, JavaScript, html, asp


> value=" here\'s a great \"quote\" to try"
>
> but for html!
>
> Thanks for your help in advance!
>
> Graham

As you've noticed,  value=  is an HTML attribute, so you have to use
HTML
entities within string.  In this case:

&quot;  for  "
&#x27;  for  '

So, you've to make a wrapper function to change quotes and apostrophes
into
entities.

Good luck

Fong


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


  Return to Index