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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

handling double quotes in attribute values

Status
Not open for further replies.

LenLindquist

IS-IT--Management
Oct 17, 2002
31
0
0
US
Hello,

I am not an ASP programmer, but I'm using an ASP utility on a Web site and have run into an issue that I believe will require ASP coding to fix. I am familiar with other programming languages, so I may stand a chance of understanding an explanation. ;)

The utility is reading a database field and inserting it into an attribute value of an html tag. This works great, except for when the database field contains a quotation mark. In this case, the browser has trouble interpreting the information.

If anyone has a slick solution, I'd love to see it. I'd settle for the ASP command to replace the double-quote character with NULL as well.

Thanks much,
Len
 
response.write replace(objRS("attribute"), """, "") Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179
mikewolf@tst-us.com (Do not email regarding this thread unless requested - I don't check this account regularly)
 
How about.....


response.write replace(objRS("attribute"),""","&qu ot;")

without the space between 'u' and 'o', when I previewed this, the &quo t; disappeared, which is probably what happened to mwolf00's
 
Actually my code appears correctly. It removes any double quote from a string. I can't imagine any attribute that would have double quotes unless you're attaching javascript events in which case you need the quotes (but different ones)


response.write replace(objRS("attribute"), """, "\'") Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179
mikewolf@tst-us.com (Do not email regarding this thread unless requested - I don't check this account regularly)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top