If I understand you correctly, you want to add another submit button, without losing the action of the first, and at the same time keep the info that was input before they clicked the second submit buttn. If that is correct, then this is how you do it.
to use 2 submit buttons, simply change use 2 different values for the submit buttons. ie,
<INPUT TYPE=submit VALUE='Submit">
<INPUT TYPE=submit VALUE='Add Box">
Then in the script from the form ACTION, you simply test the variable $submit for it's value to determine if youy proccess the form, or add the new input box
if ($submit == 'Submit'){
//process form here;
}else if ($submit == 'Add Box'){
//add the new input box and reload the form
}
To keep the values already added to the form, beofre adding the new box, simply echo the variables to the form. When the form is first loades, the variables will be null, and no values are printed. If they contain value when the 'Add Box' submit button is clicked, they will have values.
ie
<FORM ACTION='foo.php' METHOD=POST>
<INPUT TYPE=text NAME='name' VALUE='<? echo $name; ?>'>
<INPUT TYPE=text NAME='email' VALUE='<? echo $email; ?>'>
</FORM>
That will do it. Keeping in mind you will have to make sure the values are global if the form is created thru a function.
It is safest to not make them global, but instead extract them from the proper array. If your using the POST method, then make $HTTP_POST_VARS global within your functions, then extract the values from within the function. That will allow you to use the values from the form, without those specific variables being made global. Your scripts are much moresecure this way.
Function myfunction()
{
global $HTTP_POST_VARS;
extract($HTTP_POST_VARS);
//do somethoing with the values $name and $email here;
}
Hope that helps. :o)