Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Drop down box to create text fields
Old 12-08-2005, 03:09 AM Drop down box to create text fields
Junior Talker

Posts: 3
Trades: 0
Drop down box to create text fields
I need a script that will create text boxes from a drop down box. So If I choose 6 from the drop down box and "enter family details" I want 6 text boxes to be created in my form on the next page.
Thanks for any help lardy .Beginner


<html>
<head>
<title>Guest list pages!</title>
<form action="Guest List.php" method="GET">
<td>Number of family members<td><br>
<SELECT NAME="Number_of_family_members" SIZE="1">
<OPTION SELECTED>1
<OPTION>2
<OPTION>3
<OPTION>4
<OPTION>5
<OPTION>6
<OPTION>7
<OPTION>8
<OPTION>9
<OPTION>10
<OPTION>11
<OPTION>12
</SELECT>
<INPUT TYPE="submit" value="Enter family details">
</form>
<html>


<html>
<head>
<title>Guest list pages!</title>
<form action=".php" method="GET">
<table>
<tr><td>Förnamn: </td><td><input type="text" name="fornamn"></td></tr>
<tr><td>Efternamn: </td><td><input type="text" name="efternamn"></td></tr>
<tr><td>Address: </td><td><input type="text" name="address"></td></tr>
<tr><td>Postnummer: </td><td><input type="text" name="postnummer"></td></tr><br>
</table>
<INPUT TYPE="submit" value="Enter next family">
<INPUT TYPE="reset" value="Reset Form">
</form>
<html>
lardy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-08-2005, 07:02 AM
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
Code:
<html>
<head>
<title>Guest list pages!</title>
</head>
<body>
<form action="" method="post">
Number of family members<br>
<SELECT NAME="Number_of_family_members" SIZE="1">
<OPTION value="1" SELECTED>1
<OPTION value="2" >2
<OPTION value="3" >3
<OPTION value="4" >4
<OPTION value="5" >5
<OPTION value="6" >6
<OPTION value="7" >7
<OPTION value="8" >8
<OPTION value="9" >9
<OPTION value="10" >10
<OPTION value="11" >11
<OPTION value="12" >12
</SELECT>
<INPUT TYPE="submit" value="Enter family details">
</form>


<?php

$i = 1;

if(!empty($_POST['Number_of_family_members']) && is_numeric($_POST['Number_of_family_members'])){

	echo "<form method='post'>";
	for($i; $i <=$_POST['Number_of_family_members']; $i++){
		echo "Insert Box $i <input type='text' name='insert".$i."'><br />\n";
	} 
	echo "<input type='submit' value='Go'>";
	echo "</form>";
}

?>
</body>
<html>
nasty php + html in one page shudder

Ibbo
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf

Last edited by ibbo; 12-08-2005 at 07:27 AM..
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Reply     « Reply to Drop down box to create text fields
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.51084 seconds with 12 queries