mmarif4u Posted April 11, 2007 Share Posted April 11, 2007 Hi everyone. I have two pages in my site. In the 1st there is form for the user Where they fill in, there is also a select box where user select numbers(child). If they select 2, i want that in the next page when they click next button there two forms appear for 2 children where they key in the details for every child. I have the coding everything but how to call 2 or 3 or 4 froms in the next page, this is a just a slightly problem. how could i do this. Code: <html><head><link rel="stylesheet" href="styles/style.css" type="text/css"></head><body> <form name="childform" action="" method="post"> <table class="text" align="center" style="BORDER-COLLAPSE: collapse" borderColor="#c0c0c0" cellSpacing="0" cellPadding="2" width="80%" border="1"> <tr> <!-- <td align="middle" width="35">No.</td> --> <td align="middle" width="142">User ID /<br /> <font color="#0000ff">ID</font></td> <td align="middle" width="142">Child's Name /<br /> <font color="#0000ff">Nama Anak</font></td> <td align="middle" width="150">Gender /<br /> <font color="#0000ff">Jantina</font></td> <td align="middle" width="150">Date of Birth /<br /> <font color="#0000ff">Tarikh Lahir</font></td> <td align="middle" width="82">Class<br /> <font color="#0000ff">Kelas</font></td> <td align="middle" width="304">Name of School /<br /> <font color="#0000ff">Nama Sekolah</font></td> </tr> <tr> <!-- <td align="middle" width="35"> <font face="Century Gothic" size="2"></font></td> --> <td width="177"> <p align="center"><input class="textbox2" size="15" name="userid1" /></p> </td> <td width="177"> <p align="center"><input class="textbox2" size="18" name="nmname_c1" /></p> </td> <td> <p align="center"><select class="textbox2" name="gender1"> <option value="1" selected>Male</option> <option value="2">Female</option> </select> <td width="160"> <p align="center"> <select class="textbox2" name="dobdd1"> <?php $days = range(1, 31); echo " "; for ($i = 0; $i < 31; $i++) { echo "<option>$days[$i]</option>"; } ?> </select> <select class="textbox2" name="dobmm1"> <?php $months = array (0=>'01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); echo " "; for ($i = 0; $i < 12; $i++) { echo "<option>$months[$i]</option>"; } ?> </select><select class="textbox2" name="dobyyyy1"> <?php $years = range(1980,2005); echo " "; for ($i = 0; $i < 26; $i++) { echo "<option>$years[$i]</option>"; } ?> </select></p> </td> <td width="82"> <p align="center"><select class="textbox2" name="cdlevel1"> <option value="1" selected>Year 1</option> <option value="2">Year 2</option> <option value="3">Year 3</option> <option value="4">Year 4</option> <option value="5">Year 5</option> <option value="6">Year 6</option> <option value="11">Form 1</option> <option value="12">Form 2</option> <option value="13">Form 3</option> </select></p> </td> <td width="250"> <p align="center"><input class="textbox2" size="25" name="nmschool1" /></p> </td> </tr> This is the form code. Code: <tr> <td align="left" class="text"> <p>No of Child/<font color="blue"><font> :</p> </td> <td align="left"> <select class="textbox2" STYLE="background-color: #F5F5DC" name="child"> <option value="1">1</option> <option value="2" selected="selected">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> </td> </tr> This is the code for select box where they select a number. Link to comment https://forums.phpfreaks.com/topic/46534-show-multiple-forms/ Share on other sites More sharing options...
tenfold Posted April 11, 2007 Share Posted April 11, 2007 try makin a variable that holds 1 whole forms code, then do a check to see how many forms it needs and echo them? Link to comment https://forums.phpfreaks.com/topic/46534-show-multiple-forms/#findComment-226592 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.