Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hyphen in my form element name...

Status
Not open for further replies.

sonicsnail

Technical User
Nov 10, 2001
48
IN
I have a page that when you click on tickboxes, it updates a textarea. I'm working with someone elses CGI and cannot change form or element "names". As you'll see, I have 'document.messaging.X-E3-Recipients.value' and JS falls over because of the hyphens.

How can I get round this??


<SCRIPT type=&quot;text/javascript&quot;>
<!--
function putText(addText) {
var addText;
var revisedMessage;
var currentMessage = document.messaging.X-E3-Recipients.value;
revisedMessage = currentMessage+addText;
document.messaging.X-E3-Recipients.value = revisedMessage;
document.messaging.X-E3-Recipients.focus();
return;
}
//-->
</SCRIPT>

----------------

<table>
<tr>
<td>Click the tick box...</td><td><input onClick=&quot;putText('this text should appear');&quot; type=&quot;checkbox&quot;></input></td>
</tr>
</table>
 
sorry.. I should have mentioned that &quot;messaging&quot; is the name of the form, and &quot;X-E3-Recipients&quot; is the name of the textarea.
 
Try this form of element addressing:
Code:
document.messages.elements['X-E3-Recipients'].whatever
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top