Click to See Complete Forum and Search --> : How to show......


lingmingfong
08-04-2003, 08:12 PM
Hi,

I would like to know if there's a way to show a sentence that contain double quote "" in the <INPUT> field?

eg sentence :
This condition is " Not Applicable" for above.

I have tried.
It can only show the sentence as : This condition is

My coding is :
<INPUT type="text" name="test" maxlength="125" size="127" value="<%=test%>">

Gollum
08-05-2003, 02:32 AM
Like Javascript, HTML can use single or double quotes to wrap attribute values, so if you want double quotes (") in your input value...

<input type=text name=test value='"A value in quotes"'>

just watch out that your value doesn't contain single quotes of course

alternatively, you could use javascript in the onload handler...

<script>
function Setup()
{
document.theform.test.value = '"A value in it\'s quotes"';
}
</script>
<body onload="Setup();">
<form name=theform><input type=text name=text></form>
</body>

Exuro
08-05-2003, 10:06 AM
You can also use the escape code for the quote:

<input type="text" value="&amp;#34;Value in quotes&amp;#34;">