G
It would seem that when I assign an HTML entity to a form text input
using "inline" javascript that it will display properly. But when
trying to set it via a function call, the entity text shows in the
field instead of the symbol it represents. The following example
produces these results on Opera 8.5 and IE 6.0
I am expecting the same results whichever way I set the contents of
"myText". Why, when choosing "function" does "©" show in the field
instead of the copy symbol? If there is something obviously wrong... I
cannot see it. Any comments are appreciated.
<head>
<title>My Test</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">
function set_it(obj)
{
obj.form.myText.value='©';
}
</script>
<form action="#" method="get">
<input name="myText" type="text" value="©" />
<input name="btn01" type="button" value="inline"
onClick="this.form.myText.value='©';"/>
<input name="btn02" type="button" value="function"
onClick="set_it(this);"/>
</form>
</body>
</html>
using "inline" javascript that it will display properly. But when
trying to set it via a function call, the entity text shows in the
field instead of the symbol it represents. The following example
produces these results on Opera 8.5 and IE 6.0
I am expecting the same results whichever way I set the contents of
"myText". Why, when choosing "function" does "©" show in the field
instead of the copy symbol? If there is something obviously wrong... I
cannot see it. Any comments are appreciated.
<head>
<title>My Test</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">
function set_it(obj)
{
obj.form.myText.value='©';
}
</script>
<form action="#" method="get">
<input name="myText" type="text" value="©" />
<input name="btn01" type="button" value="inline"
onClick="this.form.myText.value='©';"/>
<input name="btn02" type="button" value="function"
onClick="set_it(this);"/>
</form>
</body>
</html>