10-16-2008, 11:45 AM
|
#2 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
You can do either PHP way, which requires the page to reload, or the JavaScript way, which doesn't. I have shown you the PHP method below, as this is the easiest way, and the best way to understand how to do it:
html4strict Code:
<form enctype="multipart/form-data" method="post"> How many text boxes shall we show? <input type="text" name="iTextboxes" value="<?php echo (int) @$_POST['iTextboxes']; ?>" /> <input type="submit" value="Generate Textboxes" /> </form>
php Code:
<?php if (isset($_POST['iTextboxes'])): ?>
<?php for ($iIndex = 0; $iIndex < (int) $_POST['iTextboxes']; $iIndex++): ?> <input type="text" name="szTextbox[]" /><br /> <?php endfor; ?>
<?php endif; ?>
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|