See if this helps you out, hopefully you can tie this in with your code. If you have any questions, let me know
///////////////////////// START //////////////////////////
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><title>Add 20</title>
<script>
var hNames = []; // Array init
var addOnAmt = 0; // add on amount init
function load()
{
hNames.push(hName1,hName2,
}
function reAdd()
{
addOnAmt = 0; // reset add on amount
// cycle through the name fields, checking for length.
// we do this in case a user deletes an entry.
// add 20 for each name that exists
for(var i=0; i<hNames.length; ++i)
{
if(hNames[i].value.length > 0)
addOnAmt += 20;
}
document.getElementById('f
}
</script>
</head>
<body onLoad="load()">
<input type="text" onchange="reAdd()" id="hName1"><br/>
<input type="text" onchange="reAdd()" id="hName2"><br/>
<input type="text" onchange="reAdd()" id="hName3"><br/>
<input type="text" onchange="reAdd()" id="hName4"><br/>
<div id="filler"></div>
</body>
</html>
///////////////////////// END///////////////////////
-monolith
Main Topics
Browse All Topics





by: ZylochPosted on 2006-03-06 at 13:01:14ID: 16118289
Hi corbinn,
In order for us to smoothly integrate this with your other Javascript code already existing, can you post your entire code?
Regards,
Zyloch