Solved

how show the quotation <input type = "text"  nale = "d" value=" he said,"I love you" " >?

Posted on 2004-10-20
7
198 Views
Last Modified: 2010-04-01
IN ASP I know method server.HTMLEncode(). but in JSP??
any help?
0
Comment
Question by:laoyaobest
7 Comments
 

Author Comment

by:laoyaobest
ID: 12362037
<html>
<head>

</head>

<body>

<input type="text" name="non_operation" value="he said,"I love you" ">

</body>
</html>
0
 
LVL 32

Accepted Solution

by:
ldbkutty earned 150 total points
ID: 12362535
0
 
LVL 27

Expert Comment

by:rrz
ID: 12365366
> but in JSP??
No, just plain java. Use the static methods in the  java.net   package.
URLEncoder.encode(inputString,"UTF-8")
URLDecoder(encodedString,"UTF-8")
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 1

Expert Comment

by:krishnaashu
ID: 12367546


try this


<input type = 'text'  nale = 'd' value=' he said,"I love you" ' >


this will print never use "(double quotes) in html always use '(single quotes)

regds

Krish
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12367719
> never use "(double quotes) in html always use '(single quotes)

Errr...  that solves it for double quotes, but what about:

<input type = 'text'  nale = 'd' value=' he'd said,"I love you" ' >

Basically, what everyone else said is the best way forward...encode your string :-)
0
 

Expert Comment

by:Kjarrialberts
ID: 12376504
If you're talking about what I think you're talking about then you can use backslash (\) to have the html ignore the qoutation mark.

like so:

<input type="text" nale="d" value="he said \"I love you\"">

this, of course, also works with apostrophes (') or anything else.
0
 

Author Comment

by:laoyaobest
ID: 12486550
I will try it tomrrow.
I need to solve both /*value=' he said,"I love you" ' */ and  /*value=' he'd said,"I love you" ' */
So I must encode my string.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

When you’re making plans to join the modern business race, you should analyze various details that may affect your results. Nowadays, millions of businesses are trying to grow into established and appreciated professional enterprises.
Employees depend heavily on their PCs, and new threats like ransomware make it even more critical to protect their important data.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

816 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

10 Experts available now in Live!

Get 1:1 Help Now