Jump to content

Archived

This topic is now archived and is closed to further replies.

fred_belanger

php forms

Recommended Posts

Hi,

I'm new here and new to PHP and I really need help with a form. Currently I have a form on a clients website that starts with a check box field, then a text field for email address. What follows is a repetition of a series of three fields:
OwnerName#1
Model#1
Serial#1

OwnerName#2
Model#2
Serial#2

This repeats through #25

I use FormMail to process the form.

Someone told me that it would be possible to provide a field before #1 that asks the user to enter the number of Serial# Researches they are requesting. Then using php there would be a loop the would loop the the number of times as the number they entered. So that if they entered 6 the next page would come up with six sets of the three fields shown above. Of course trhe person who told me this could "easily" be done in PHP couldn't tell me how.

I hope this makes sense and if so is it possible? And if it is possible would you be able to show me how to do it? Again, I'm new here and hope I'm not asking too much....I just need help.

Thanks in advance for any input.

Fred

Share this post


Link to post
Share on other sites
Yes, it can be done easily :)
Can you just paste the form here?

Orio.

Share this post


Link to post
Share on other sites
Orio,

Thanks for your prompt reply. It's a long form. FYI, just for privacy reasons I replaced specific client info with CompanyName in the form. Here it is:

[code]<form action="http://www.CompanyName.com/cgi-url/formmail.cgi" method="POST" onSubmit="MM_validateForm('email','','RisEmail');return document.MM_returnValue" >
                <input type="hidden" name="redirect" value="http://www.CompanyName.com/research_orderB.htm">
                <input type="hidden" name="recipient" value="sales@CompanyName.com">               
                <p align="center" class="bold">Enter your e-mail address, then up to 25 searches:<br>
          If you have more than 25 Serial Number searches please call us at:<font color="#008080" face="Verdana, Arial, Helvetica, sans-serif" class="subhead111"><br>
          </font><font face="Verdana, Arial, Helvetica, sans-serif">1-888-555-1212<br>
          1-888-555-1212</font> </p>
                <p align="left" class="body1">Persons wanting to receive the document flat for framing (to avoid the creases made by folding) should include an <strong>additional $6.00</strong> for Priority Mailing in a reinforced package. Several documents can be mailed together in the same reinforced package at no additional mailing charge when searches are ordered together. If you choose this option the $6.00 charge will be added when your credit card is processed - it will not show up on-line in the shopping cart.</p>
                <table width="97%" border="0" cellspacing="0" cellpadding="0">
                  <tr bgcolor="#20A820">
                    <td colspan="2" class="body1"><div align="center" class="boldwhite"><strong><br>
                      Please be sure to scroll to the bottom of the page after entering <br>
                      your document information in order to proceed. <br>
                      <br>
                    </strong></div></td>
                  </tr>
                  <tr>
                    <td colspan="2" class="body1"><div align="center"></div></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"><br>
                      Check this box if you want the flat shipping option at an additional charge of $6.00<br>
                            <br>
                    </div></td>
                    <td class="body1"><input name="FlatShipping" type="checkbox" id="FlatShipping" value="checkbox"></td>
                  </tr>
                  <tr>
                    <td width="56%" class="body1"><div align="right">Your E-mail Address:</div></td>
                    <td width="44%" class="body1"><input type="text" name="email">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1">&nbsp;</td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #1: </div></td>
                    <td class="body1"><input name="Name1" type="text" id="Name1" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #1:</div></td>
                    <td class="body1"><input type="text" name="model1" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td width="56%" class="body1"><div align="right">Serial #1:</div></td>
                    <td width="44%" class="body1"><input type="text" name="serial1" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #2: </div></td>
                    <td class="body1"><input name="Name2" type="text" id="Name2" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #2:</div></td>
                    <td class="body1"><input name="model2" type="text" id="model2" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #2:</div></td>
                    <td class="body1"><input name="serial2" type="text" id="serial2" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #3: </div></td>
                    <td class="body1"><input name="Name3" type="text" id="Name3" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #3:</div></td>
                    <td class="body1"><input name="model3" type="text" id="model3" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #3:</div></td>
                    <td class="body1"><input name="serial3" type="text" id="serial3" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #4: </div></td>
                    <td class="body1"><input name="Name" type="text" id="Name" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #4:</div></td>
                    <td class="body1"><input name="model4" type="text" id="model4" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #4:</div></td>
                    <td class="body1"><input name="serial4" type="text" id="serial4" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #5: </div></td>
                    <td class="body1"><input name="Name5" type="text" id="Name5" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #5:</div></td>
                    <td class="body1"><input name="model5" type="text" id="model5" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #5:</div></td>
                    <td class="body1"><input name="serial5" type="text" id="serial5" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #6: </div></td>
                    <td class="body1"><input name="Name6" type="text" id="Name6" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #6:</div></td>
                    <td class="body1"><input name="model6" type="text" id="model6" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #6:</div></td>
                    <td class="body1"><input name="serial6" type="text" id="serial6" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #7: </div></td>
                    <td class="body1"><input name="Name7" type="text" id="Name7" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #7:</div></td>
                    <td class="body1"><input name="model7" type="text" id="model7" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #7:</div></td>
                    <td class="body1"><input name="serial7" type="text" id="serial7" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #8: </div></td>
                    <td class="body1"><input name="Name8" type="text" id="Name8" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #8:</div></td>
                    <td class="body1"><input name="model8" type="text" id="model8" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #8:</div></td>
                    <td class="body1"><input name="serial8" type="text" id="serial8" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #9: </div></td>
                    <td class="body1"><input name="Name9" type="text" id="Name9" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #9:</div></td>
                    <td class="body1"><input name="model9" type="text" id="model9" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #9:</div></td>
                    <td class="body1"><input name="serial9" type="text" id="serial9" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #10: </div></td>
                    <td class="body1"><input name="Name10" type="text" id="Name10" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #10:</div></td>
                    <td class="body1"><input name="model10" type="text" id="model10" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #10:</div></td>
                    <td class="body1"><input name="serial10" type="text" id="serial10" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #11: </div></td>
                    <td class="body1"><input name="Name11" type="text" id="Name11" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #11:</div></td>
                    <td class="body1"><input name="model11" type="text" id="model11" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #11:</div></td>
                    <td class="body1"><input name="serial11" type="text" id="serial11" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #12: </div></td>
                    <td class="body1"><input name="Name12" type="text" id="Name12" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #12:</div></td>
                    <td class="body1"><input name="model12" type="text" id="model12" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #12:</div></td>
                    <td class="body1"><input name="serial12" type="text" id="serial12" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #13: </div></td>
                    <td class="body1"><input name="Name13" type="text" id="Name13" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #13:</div></td>
                    <td class="body1"><input name="model13" type="text" id="model13" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #13:</div></td>
                    <td class="body1"><input name="serial13" type="text" id="serial13" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #14: </div></td>
                    <td class="body1"><input name="Name14" type="text" id="Name14" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #14:</div></td>
                    <td class="body1"><input name="model14" type="text" id="model14" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #14:</div></td>
                    <td class="body1"><input name="serial14" type="text" id="serial14" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #15: </div></td>
                    <td class="body1"><input name="Name15" type="text" id="Name15" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #15:</div></td>
                    <td class="body1"><input name="model15" type="text" id="model15" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #15:</div></td>
                    <td class="body1"><input name="serial15" type="text" id="serial15" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #16: </div></td>
                    <td class="body1"><input name="Name16" type="text" id="Name16" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #16:</div></td>
                    <td class="body1"><input name="model16" type="text" id="model16" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #16:</div></td>
                    <td class="body1"><input name="serial16" type="text" id="serial16" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #17: </div></td>
                    <td class="body1"><input name="Name17" type="text" id="Name17" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #17:</div></td>
                    <td class="body1"><input name="model17" type="text" id="model17" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #17:</div></td>
                    <td class="body1"><input name="serial17" type="text" id="serial17" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #18: </div></td>
                    <td class="body1"><input name="Name18" type="text" id="Name18" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #18:</div></td>
                    <td class="body1"><input name="model18" type="text" id="model18" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #18:</div></td>
                    <td class="body1"><input name="serial18" type="text" id="serial18" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #19: </div></td>
                    <td class="body1"><input name="Name19" type="text" id="Name19" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #19:</div></td>
                    <td class="body1"><input name="model19" type="text" id="model19" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #19:</div></td>
                    <td class="body1"><input name="serial19" type="text" id="serial19" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #20: </div></td>
                    <td class="body1"><input name="Name20" type="text" id="Name20" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #20:</div></td>
                    <td class="body1"><input name="model20" type="text" id="model20" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #20:</div></td>
                    <td class="body1"><input name="serial20" type="text" id="serial20" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #21: </div></td>
                    <td class="body1"><input name="Name21" type="text" id="Name21" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #21:</div></td>
                    <td class="body1"><input name="model21" type="text" id="model21" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #21:</div></td>
                    <td class="body1"><input name="serial21" type="text" id="serial21" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #22: </div></td>
                    <td class="body1"><input name="Name22" type="text" id="Name22" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #22:</div></td>
                    <td class="body1"><input name="model22" type="text" id="model22" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #22:</div></td>
                    <td class="body1"><input name="serial22" type="text" id="serial22" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #23: </div></td>
                    <td class="body1"><input name="Name23" type="text" id="Name23" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #23:</div></td>
                    <td class="body1"><input name="model23" type="text" id="model23" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #23:</div></td>
                    <td class="body1"><input name="serial23" type="text" id="serial23" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #24: </div></td>
                    <td class="body1"><input name="Name24" type="text" id="Name24" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #24:</div></td>
                    <td class="body1"><input name="model24" type="text" id="model24" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #24:</div></td>
                    <td class="body1"><input name="serial24" type="text" id="serial24" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Name as it will appear on document #25: </div></td>
                    <td class="body1"><input name="Name25" type="text" id="Name25" size="30"></td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Model #25:</div></td>
                    <td class="body1"><input name="model25" type="text" id="model25" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right">Serial #25:</div></td>
                    <td class="body1"><input name="seria25" type="text" id="seria25" size="30">
                    </td>
                  </tr>
                  <tr>
                    <td class="body1"><div align="right"></div></td>
                    <td class="body1">&nbsp;</td>
                  </tr>
                </table>
                <p align="left" class="bold">&nbsp;</p>
                <p align="center">
                  <input type="submit" name="Submit" value="Proceed to Step 2">
                  <input type="reset" name="Reset" value="Reset">
                </p>
              </form>[/code]

Share this post


Link to post
Share on other sites
Oh, I thought the form's action is also in PHP... So unless you want to add another page that asks how many fields to generate, this cant be done with php. Although you can implant some JavaScript that will change the page dynamicly according to a drop down. But that's not the place for that, if you need help for that you can go to the JavaScript boards here in PHPFreaks.

Orio.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.