Solved

sending a single quote in html parameters

Posted on 2002-03-28
10
203 Views
Last Modified: 2010-04-09
I am building an A href.  The href MUST contain a single quote in the parameter.  When i link, the html truncates at the single quote.
the link looks like this. It is using two seperate single quotes.  

<A href = theAsset.jsp?AssetName=19'' Dell>19'' Dell</A>

However when the mouse is hovered over the link the link appears as so:

theAsset.jsp?AssetName=19

How can i fix this?

Is there a way to fix this so each line does not need escape sequences.  In other words so that the page need not be hard coded on each line to fix it.  This is important because I will not always know when single quotes are in the link.

Finally, why is this happening?

0
Comment
Question by:rm3
  • 2
  • 2
  • 2
  • +4
10 Comments
 
LVL 4

Expert Comment

by:ckosloski
ID: 6903554
Hi rm3,

You need to but double quotes around the your link as follows:
<A href="theAsset.jsp?AssetName=19'' Dell">19'' Dell</A>
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 50 total points
ID: 6903633
to make it work in netscape also

<a href="thisAsset.jsp?AssetName=19%27%27%20Dell">19 Dell</a>

or

<a href="" onClick="this.href=escape('theAsset.jsp?AssetName=19\'\' Dell')">Dell 19M</a>

CJ
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 6904398
Ya for certain special characters you need to place the \ before the characters itself; this i guess is a primitive dos standard still followed; the single quote is one of these special characters;

others are
\n -> New Line
\\ -> Backslash
\" -> Double Quotes

in modern day use, withing a pair of quotes, if quotes apper, they should have the \ character before them, which says that this isn't the end of quotes but is just the haracter;

lexxwern
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6904836
safest is CJ_S's recommendation.
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 6905010
agree
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 11

Expert Comment

by:mouatts
ID: 6913658
CJs is the only correct HTML solution. Using any illegal character in a URL will give you different problems across different browsers, colons for example work in one browser but not in another (thats IE and Netscrap, not tried it on any others)

Steve
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6975502
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

Cd&
0
 
LVL 11

Expert Comment

by:mouatts
ID: 6976857
points to CJS I reckon
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7003661
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to CJ_S

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7066757
Thanks, Cd&, for your help here.

This has been finalized today, and monitoring for comments.

Moondancer - EE Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now