I want to upload a text file but I can select which php process will it be based on selection. I tried to combine some codes but it does not work. Here is my html code:
<h3>Upload Time Logs</h3>
<fieldset>
<legend><strong>Select type of machine model</strong></legend>
<select id="cmbmachine" name="machine" class="field" onChange="this.form.action=this.option[this.selectedIndex].value;">
<option value="machine1.php">Machine 1</option>
<option value="machine2.php">Machine 2</option>
</select>
</fieldset>
<fieldset>
<legend><strong>Select a file to upload</strong></legend>
<form id="form1" action="" method="post" enctype="multipart/form-data">
<input type="file" name="files[]" size="40" multiple="multiple" />
<br />
<p></p>
<input type="submit" value="Upload File" />
<br />
<br />
</form>
<div id="information"></div>
</fieldset>
<fieldset>
<legend><strong>Uploaded Files</strong></legend>
<div id="uploaded"></div>
</fieldset>
I tried this suggestions Change Form "action" on selection, javascript - change form action based on selection? but it seems it does not help.. What am I doing wrong?..