|
Q1366 How can I determine the subscript in the forms array when I only have a reference to the form and not the name of the form?
irt.org | Knowledge Base | JavaScript | Form | Q1366 [ previous next ]
Q1366 How can I determine the subscript in the forms array when I only have a reference to the form and not the name of the form?
Try:
<script language="JavaScript"><!--
function computeRow(what) {
for (var i=0;i<document.forms.length;i++)
if (document.forms[i] == what)
alert('We have a match : ' +i);
}
//--></script>
<form>
<input type="text" onChange="computeRow(this.form)">
</form>
<form>
<input type="text" onChange="computeRow(this.form)">
</form>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.