[Javascript] javascript question. please help
Heidi Castillo
castilloheidi at yahoo.com
Thu Feb 27 13:37:31 CST 2003
I need to know who to split a form into to arrays. can you help?
<html>
<head>
<script language=javascript>
function farmcount()
{
var s=document.farmform;
var fn= new Array(9);
var fc= new Array(9);
for(i=0; i<20; i++)
{
loc=i/2;
fn(loc)=s.elements[i].value;
}
document.write(fn(loc));
}
</script>
</head>
<body>
<center>
<form name="farmform">
<input type="text" size="20" value="Cows">
<input type="text" size="4" value="77"><p>
<input type="text" size="20" value="Sheep">
<input type="text" size="4" value="120"><p>
<input type="text" size="20" value="Goats">
<input type="text" size="4" value="3"><p>
<input type="text" size="20" value="Pigs">
<input type="text" size="4" value="3"><p>
<input type="text" size="20" value="Horses">
<input type="text" size="4" value="3"><p>
<input type="text" size="20" value="Mules">
<input type="text" size="4" value="17"><p>
<input type="text" size="20" value="Chickens">
<input type="text" size="4" value="43"><p>
<input type="text" size="20" value="Ducks">
<input type="text" size="4" value="120"><p>
<input type="text" size="20" value="Raptors">
<input type="text" size="4" value="7"><p>
<input type="button" value="GO" onClick="farmcount()">
</form>
</center>
</body>
</htnl>
---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20030227/1171b850/attachment.htm>
More information about the Javascript
mailing list