The following script dynamically creates a select box and names it. I want to dynamically add an onfocus event handler that changes the value of the boxname variable to the value of the name of the form.
When I click the first form boxname=0, when I click the second boxname=1 ,etc.,etc.
Any help on this would be greatly appreciated.
<SCRIPT language="Javascript">
var boxname=0;
function createlist(){
newlist= document.createElement("SELECT");
newlist.name=boxname;
document.selectform.appendChild(newlist);
boxname++;
}
</SCRIPT>
When I click the first form boxname=0, when I click the second boxname=1 ,etc.,etc.
Any help on this would be greatly appreciated.
<SCRIPT language="Javascript">
var boxname=0;
function createlist(){
newlist= document.createElement("SELECT");
newlist.name=boxname;
document.selectform.appendChild(newlist);
boxname++;
}
</SCRIPT>