Solved

Apostrophe in VBScript on an ASP page

Posted on 2004-09-01
2
934 Views
Last Modified: 2012-08-14
I have an apostrophe problem showing up on an ASP page. The apostrophe acts like a delimiter and I tried just about everything. I'm using a Response.Write statement like this...

Response.Write(CHR(13) & "<td class='resultsrow" & intRow & "'><INPUT type=checkbox name='clipboard" & intClipBoardNumber & "' value='http://" & sLink & "/documents/" & sRadarFileNumber & "     " & sValue & "'></td>")

The problem is when sValue has an apostrophe in it. I tried to replace the apostrophe with douple apostrophes and this doesn't work because of the apostrophe after "value=".
0
Comment
Question by:wseaward
[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
2 Comments
 
LVL 4

Expert Comment

by:MrClean21
ID: 11952986
Hi wseaward,

Use Server.URLEncode(sValue)

MrClean
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 125 total points
ID: 11958909
A different approach is to use the quotation mark as the delimiter. However, you need to double them up, so if you want name="strFirstName" you would write instead name=""strFirstName""

Here it is with your string:

Response.Write(CHR(13) & "<td class=""resultsrow" & intRow & """><INPUT type=checkbox name=""clipboard" & intClipBoardNumber & """ value=""http://" & sLink & "/documents/" & sRadarFileNumber & "     " & sValue & """></td>")


FtB
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Time Conversions...both ways 2 32
Debugging Html 8 44
Display if field is NOT "" or NOT null 6 37
ms sql and asp dates 5 43
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

751 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