Link to home
Start Free TrialLog in
Avatar of laoyaobest
laoyaobest

asked on

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

IN ASP I know method server.HTMLEncode(). but in JSP??
any help?
Avatar of laoyaobest
laoyaobest

ASKER

<html>
<head>

</head>

<body>

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

</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of ldbkutty
ldbkutty
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rrz
> 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")


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
> 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 :-)
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.
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.