I have a form with 2 mandatory fields and one optional.
I want to add a submit button outside of this form, so that when we have a value for folder_name and you click on it, it runs php and searches for all the files under that server:
<form name="runConsultation" method="post" action=""> <input type="text" name="folder_name"> <select name="files" size="3"> <?php // pupulate the list with values found outside the form ?> <select> <select name="category"> <option value="">Select...</option> <option value="a">A</option> <option value="b">B</option> </select> <input type="submit" name="run-consultation" value="RUN CONSULTATION"> </form> <input type="submit" name="find-files" value="FIND FILES"> My problem is that I don't know how to do that without using 2 forms.
If I add 2 forms, I need to separate folder_name from the of the fields and when I run the consultation, I lose access to folder_name.
Can anybody help? Thank you in advance.
Example:
<form name="fileSearch" method="post" action="" > <input type="text" name="folder_nr"> <input type="submit" value="Search For Files" name="search-folder"> </form> <form name="runConsultation" method="post" action=""> <select name="files" size="3"> <?php // building my list with the files found using the first form ?> ... <input type="submit" name="run-consultation" value="Run Consultation"> </form> when I run seach-folder, folder_number disappears.
<input type="text" name="folder_nr" value="<?php echo @$_REQUEST['folder_nr'];?>">