Hi guys,
Not sure if anyone can help me :/
Basically - I have this code;
<head>
<title>New Page 6</title>
</head>
<body>
<script type="text/javascript">
function makeFormsFields(numberoffields) {
alert('number of fields to make: ' + numberoffields);
for (var i=0; i<numberoffields; i++) {
var newInput = document.createElement('input');
newInput.type = 'text';
newInput.name = 'input' + (i+1);
newInput.size = '20';
newInput.value = 'New input ' + (i+1);
document.forms[0].appendChild(newInput);
}
}
</script>
<form method="POST" action="#">
<p>
<select size="1" name="NumberOfFiles" onchange="makeFormsFields(this.value);">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
</p>
</form>
</body>
</html>
This gives a dropdown box, with a text box incrimenting, each "printing" (i.e text1, text2, etc).
My problem comes with this - I need to output a much more advanced set of content :/
i.e (for each one);
<tr>
<td width="153"><b>Document XX</b></td>
<td> </td>
</tr>
<tr>
<td width="153">Level of Document:</td>
<td><select size="1" name="LevelXX">
<option>GCSE</option>
<option>A-Level</option>
<option>I.B</option>
<option>University</option>
</select></td>
</tr>
<tr>
<td width="153">Number of Words:</td>
<td><input type="text" name="NumberOfWordsXX" size="20"></td>
</tr>
<tr>
<td width="153">File:</td>
<td><input type="file" name="FileNameXX" size="20"></td>
</tr>
</table>
I tried document.write, but apparantly that "overwrites" existing content, if run AFTER the page has loaded.
Is what I'm doing even possible? I've hit a bit of a major road block :(
TIA!
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Not sure if anyone can help me :/
Basically - I have this code;
Code:
<html> <head>
<title>New Page 6</title>
</head>
<body>
<script type="text/javascript">
function makeFormsFields(numberoffields) {
alert('number of fields to make: ' + numberoffields);
for (var i=0; i<numberoffields; i++) {
var newInput = document.createElement('input');
newInput.type = 'text';
newInput.name = 'input' + (i+1);
newInput.size = '20';
newInput.value = 'New input ' + (i+1);
document.forms[0].appendChild(newInput);
}
}
</script>
<form method="POST" action="#">
<p>
<select size="1" name="NumberOfFiles" onchange="makeFormsFields(this.value);">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
</p>
</form>
</body>
</html>
This gives a dropdown box, with a text box incrimenting, each "printing" (i.e text1, text2, etc).
My problem comes with this - I need to output a much more advanced set of content :/
i.e (for each one);
Code:
<table border="1" style="border-collapse: collapse" width="47%" id="table1"> <tr>
<td width="153"><b>Document XX</b></td>
<td> </td>
</tr>
<tr>
<td width="153">Level of Document:</td>
<td><select size="1" name="LevelXX">
<option>GCSE</option>
<option>A-Level</option>
<option>I.B</option>
<option>University</option>
</select></td>
</tr>
<tr>
<td width="153">Number of Words:</td>
<td><input type="text" name="NumberOfWordsXX" size="20"></td>
</tr>
<tr>
<td width="153">File:</td>
<td><input type="file" name="FileNameXX" size="20"></td>
</tr>
</table>
I tried document.write, but apparantly that "overwrites" existing content, if run AFTER the page has loaded.
Is what I'm doing even possible? I've hit a bit of a major road block :(
TIA!
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!