Copy link to clipboard
Copied
I'm trying to populate a drop down box in a form(form2) dynamically using a form variable from a different form(form1) on the same php page. does anyone know what i should set the action as for form 1 so that when form 1 is submitted form 2 is populated from the form variable? Any advice is appreciated.
Copy link to clipboard
Copied
Your could use either method, POST or GET. <form action='' method="post">
Then put code such as the following somewhere, probably above the forms.
if ($_POST['name_of_form_one_submit']){
$variable1 = $_POST['variable1'];
}
Then your dropdown in form2 will dynamically be populated with the variable as follows:
<select name='drop_down_variable_name'>
option value= "<?php echo $variable1 ?>"><?php echo $variable1 ?></option>
Copy link to clipboard
Copied
Thanks for the answer. I have a similar problem. Going to try this out.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now