Quote problem (ASP)
Hi,
While using ASP I retrieve a bunch of products out of MS Acces db into a HTML-<select>. When user clicks on one or more products these product are passed to the next page. Here I want the selected product(s) to be displayed in a HTMl<table>. This works fine, but I got a problem when one of the products contains a quote/inch-sign.
I know I can remove the quotes in the db-fields but that seems to be a lot of work.
(3000 items)
Does anyone know how to filter these quotes??
Thanx in advance,
Jack
Shakespeare: onclick || !(onclick)
RC posted this at 13:35 — 17th January 2000.
They have: 89 posts
Joined: Sep 1999
I THINK that this can be accomplished using the VBScript replace function. Here is the code that replaces single quotes with double quotes from a feedback form. You should be able to alter it to fit your needs.
strCompanyName = Replace(Request.form("NAME"), "'", "''")
or if not, maybe you can look into the replace function and figure something out.
Eugene Grinberg posted this at 23:58 — 17th January 2000.
They have: 47 posts
Joined: Jan 2000
The best thing to do is to convert everything to HTML format by using Server.HTMLEncode. This will convert all " to " and you won't have any problems.
do something like this:
Response.Write(Server.HTMLEncode(varRecordSet("DB_Field")))
Eugene
[This message has been edited by Eugene Grinberg (edited 17 January 2000).]
Jack Michaelson posted this at 07:40 — 20th January 2000.
He has: 1,733 posts
Joined: Dec 1999
I think I'll go for Eugene's solution. In fact, I'm using the HTMLEncode on other pages. So why it didn't came up to me to use it here also will always be a mystery I think Thanks anyway RC & Eugene.
Jack.
Shakespeare: onclick || !(onclick)
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.