The JS below will insert predefined text into the area text box when you
click on the smileys. This sample script is working fine.
But my problem is, in my PHP script, the "myfieldnam e" below is
"message.bo dy". The dot in the field name is giving problem to the JS.
The JS stop working if it is:
document.myform name.message.bo dy.value += ' ' + theSmilie + ' ';
document.myform name.message.bo dy.focus();
How to go about this? I cannot change the field name.
=============== =============== =============== =
<script language="javas cript">
<!--
function emoticon(theSmi lie) {
document.myform name.myfieldnam e.value += ' ' + theSmilie + ' ';
document.myform name.myfieldnam e.focus();
}
//-->
</script>
</head>
<body>
<form name="myformnam e">
<textarea name="myfieldna me" cols="48" rows="10"></textarea>
<a href="javascrip t:emoticon(':sm ile:')"><img src="gfx/icon_smile.gif" "
border="0"></a>
<br>
<a href="javascrip t:emoticon(':gr in:')"><img src="gfx/icon_biggrin.gi f""
border="0"></a>
click on the smileys. This sample script is working fine.
But my problem is, in my PHP script, the "myfieldnam e" below is
"message.bo dy". The dot in the field name is giving problem to the JS.
The JS stop working if it is:
document.myform name.message.bo dy.value += ' ' + theSmilie + ' ';
document.myform name.message.bo dy.focus();
How to go about this? I cannot change the field name.
=============== =============== =============== =
<script language="javas cript">
<!--
function emoticon(theSmi lie) {
document.myform name.myfieldnam e.value += ' ' + theSmilie + ' ';
document.myform name.myfieldnam e.focus();
}
//-->
</script>
</head>
<body>
<form name="myformnam e">
<textarea name="myfieldna me" cols="48" rows="10"></textarea>
<a href="javascrip t:emoticon(':sm ile:')"><img src="gfx/icon_smile.gif" "
border="0"></a>
<br>
<a href="javascrip t:emoticon(':gr in:')"><img src="gfx/icon_biggrin.gi f""
border="0"></a>
Comment