Show Form Name

[Total: 0    Average: 0/5]

This shows how to pass the text name of the form and its components.

Body Code:

<script>
function doIt(_n)
{
alert(_n);
}
</script>
<form name=mynameis>
<input type=text name=idonthaveaname>
<input type=button name=imabutton onclick=doIt(this.name) value=A>
<input type=button onclick=doIt(this.form.name) value=B>
<input type=button onclick=doIt(document.form[0].name) value=C>
<input type=button onclick=doIt(this.form.elements[0].name) value=D>
</form>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *