THE OUTPUT:
[img=[url="http://img124.imageshack.../img124.imageshack.us/img124/43/testinis2.gif][/url]
THE CODE:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<script>
var arrInput = new Array(0);
var arrInputValue = new Array(0);
function value_getter (form) {
var TestVar = form.number_of_periods.value;
return TestVar;
}
function addInput() {
//arrInput.push(createInput(arrInput.length));
arrInput.push(arrInput.length);
//arrInputValue.push(arrInputValue.length);
arrInputValue.push("");
display();
}
function display() {
document.getElementById('empty_space').innerHTML="";
for (intI=0;intI<arrInput.length;intI++) {
document.getElementById('empty_space').innerHTML+=createInput(arrInput[intI], arrInputValue[intI]);
}
}
function saveValue(intId,strValue) {
arrInputValue[intId]=strValue;
}
function createInput(id,value) {
return " Period "+ id +" : <input type='text' id='test "+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'> duration : <input type='text' id='test "+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'> Downlink: <input type='text' id='test "+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'> Dataintake : <input type='text' id='test "+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'> Number of Tracks : <input type='text' id='test "+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'> Track Duration: <input type='text' id='test "+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'><br>";
}
function create_period(int){
for(i=1 ; i <= int ; i++){
addInput();
}
}
</script>
</head>
<body>
<form name="project" action="graph_builder.php" method="post">
<p>Project Name: <input type="text" name="project_name"></p>
<p>Number of Periods: <input type="text" value="" name="number_of_periods">
<input type="button" value="set" name="set" ******="create_period(value_getter(this.form))"> </p>
<p id="empty_space"> </p>
<p><input type="submit" /></p>
</form>
<p><center>
<font face="arial, helvetica" SIZE="-2">Free JavaScripts provided<br>
by <a href="
http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
</body>
</html>