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!

URL Encoding with an apostrophe 1

Status
Not open for further replies.

sdidomenico

Programmer
Sep 26, 2003
34
0
0
US
Hello,

Can someone provide me with the correct URL Encoding or another solution for this code?

<input type="button" value="enter note" onclick="window.location='/donor/manage_note.asp?iDonorId=100002340&sDonorName=Mr Test M Re' Cord'">

Our problem is when sDonorName contains an apostrophe, the button/link does not work.

Thanks in advance for your time,

Steve DiDomenico
Nashua, NH
 
can you tryin "escaping" the apostrophe

ie Mr. Donor/'s Rec/'rd
 
You can escape the apostrophes by using \' thus:

Code:
<input type="button" value="enter note" onclick="window.location='/donor/manage_note.asp?iDonorId=100002340&sDonorName=Mr Test M Re\' Cord'">

Hope this helps,
Dan
 
Thanks for the helpful posts.

I was able to use Dan's suggestion and use VBScript to Replace the ' with \' and the buttons work fine.

Thanks again,

Steve DiDomenico
Nashua, NH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top