Forum Moderators: open
It will attach an onkeypress event to your input tags when in the onload event. No need to hand code each <input> element.
Hope this helps.
But, I appreciate the help; and it's probably something I'll use in the future with links.
- Ryan
<HEAD>
<TITLE>Adding onkeypresses to every textarea.</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!--
function="alert()";
function eventsAdd()
{
var z=document.getElementsByTagName("textarea");
for(var y=0;y<z.length;y++)
{
z[y].onkeypress=new Function(function);
}
}
//-->
</SCRIPT>
</HEAD>
<BODY ONLOAD="eventsAdd()">Textarea 1: <textarea></textarea>
<BR>
Textarea 2: <textarea></textarea>
</BODY>