[thelist] dynamic javascript loop help

Robert Vreeland vreeland at studioframework.com
Tue Jan 18 11:24:04 CST 2005


Robert Vreeland
Managing Partner
StudioFramework
508 965 5819
vreeland at studioframework.com
----- Original Message ----- 
From: <Chris.Marsh at Callserve.com>
To: <thelist at lists.evolt.org>
Sent: Tuesday, January 18, 2005 11:20 AM
Subject: RE: [thelist] dynamic javascript loop help


> Robert
>
> > Yes, I have tried it in other browsers without problems.
>
> Caught out, sir ;) This doesn't even work in IE - nor should it
So you are right, I forgot the refrence to the elements collection. I've
included it in the tested code (IE and Firefox) below.
<html>
<head>
<script type="text/javascript">
function testform(theform){

a = 0;
f = 1;
nDatarow = "datarow_" + a + "_col_" + f;
nValue = "row_" + a + "_col_" + f;
theform.elements[nDatarow].value =
document.getElementById(nValue).innerHTML;
return false;
}
</script>
</head>
<body>
<form onsubmit="return testform(theform)" name="theform">
<input type="text" name="datarow_0_col_1" value="">
<table>
<tr>
<td id="row_0_col_1">Some test info</td>
</tr>
</table>
<input type="button" onclick="testform()" value="click me">
<input type="submit">
</form>
</body>
</html>

By the way, since you picked up on the error why didn't you post a
correction?
>
> Regards
>
> Chris Marsh
>
> <tip type='etiquette'>
> If you supply code to illustrate a solution to a query, but haven't
> had the time to test it, add a disclaimer to this effect for the benefit
of
> less experienced list subscribers.
> </tip>
>
> _______________________________________________________________________
> This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender and delete
the email immediately. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.
>
> Please note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the company.
>
> Finally, the recipient should check this email and any attachments for the
presence of viruses. Callserve Communications accepts no liability for any
damage caused by any virus transmitted by this email.
_______________________________________________________________________
> This email has been scanned for all viruses by the MessageLabs SkyScan
> service.
> -- 
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !



More information about the thelist mailing list