Log in

View Full Version : toggle but not



bluewalrus
01-11-2009, 09:02 PM
I want something similar to a toggle but with it being interpreted. I think this would have to be javascript but am not sure maybe another language could do it as well.
I have a form. I want the user to be able to type in the number of images they want to upload. Then that number of file inputs comes down. This is my forms code. Any ideas I appreciate thanks.




<form action="mwtmpsubmit.php" method="post">
<textarea name="content">Enter Content Here</textarea><br />
How many images do you want to upload?<input type="text" name="files" /><br />
<input name="userfile[]" type="file" />
<input type="submit" value="Create Page" />
</form>

bluewalrus
01-13-2009, 12:36 AM
I think it would be something like this but this is a mashing of php and javascript?. I guess i'd also need some javascript to take out that number entry after the while was performed or make it hidden or display none. Thanks.


i=0
<input name="number" type="text" />

while ( i > number {
echo "<input name="userfile[]" type="file" />";
i = i + 1;
}