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?
any help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> but in JSP??
No, just plain java. Use the static methods in the java.net package.
URLEncoder.encode(inputStr ing,"UTF-8 ")
URLDecoder(encodedString," UTF-8")
No, just plain java. Use the static methods in the java.net package.
URLEncoder.encode(inputStr
URLDecoder(encodedString,"
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 :-)
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.
like so:
<input type="text" nale="d" value="he said \"I love you\"">
this, of course, also works with apostrophes (') or anything else.
ASKER
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.
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.
ASKER
<head>
</head>
<body>
<input type="text" name="non_operation" value="he said,"I love you" ">
</body>
</html>