B
Blue
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 "myfieldname" below is
"message.body". The dot in the field name is giving problem to the JS.
The JS stop working if it is:
document.myformname.message.body.value += ' ' + theSmilie + ' ';
document.myformname.message.body.focus();
How to go about this? I cannot change the field name.
==============================================
<script language="javascript">
<!--
function emoticon(theSmilie) {
document.myformname.myfieldname.value += ' ' + theSmilie + ' ';
document.myformname.myfieldname.focus();
}
//-->
</script>
</head>
<body>
<form name="myformname">
<textarea name="myfieldname" cols="48" rows="10"></textarea>
<a href="javascript:emoticon(':smile:')"><img src="gfx/icon_smile.gif""
border="0"></a>
<br>
<a href="javascript:emoticon(':grin:')"><img src="gfx/icon_biggrin.gif""
border="0"></a>
click on the smileys. This sample script is working fine.
But my problem is, in my PHP script, the "myfieldname" below is
"message.body". The dot in the field name is giving problem to the JS.
The JS stop working if it is:
document.myformname.message.body.value += ' ' + theSmilie + ' ';
document.myformname.message.body.focus();
How to go about this? I cannot change the field name.
==============================================
<script language="javascript">
<!--
function emoticon(theSmilie) {
document.myformname.myfieldname.value += ' ' + theSmilie + ' ';
document.myformname.myfieldname.focus();
}
//-->
</script>
</head>
<body>
<form name="myformname">
<textarea name="myfieldname" cols="48" rows="10"></textarea>
<a href="javascript:emoticon(':smile:')"><img src="gfx/icon_smile.gif""
border="0"></a>
<br>
<a href="javascript:emoticon(':grin:')"><img src="gfx/icon_biggrin.gif""
border="0"></a>