Welcome Guest, Not a member yet? Register   Sign In
get the value of a dropdown select..
#1

[eluser]masentinel900[/eluser]
I have in my website a uploader of files. I should to be a dropdown list with some folders which going to redirect the file upload.

So, If I selected folder A. the file that I upload will go it to this selected folder.

My question is..

How can I get the value of option selected?

My Idea is set the value of selected option in a variable "$x" for may put in the upload path..
#2

[eluser]PhilTem[/eluser]
Code:
$x = $this->input->post('input_field_name_of_dropdown');
#3

[eluser]Lotus[/eluser]
[code]
<form action="MyFormProcessorController/processForm" method="post">
<select name="mySelect&gt;
&lt;option value="folderA">Folder A</option>
<option value="folderB">Folder B</option>
<option value="folderC">Folder C</option>
</select>
&lt;/form&gt;

.
.
.

class MyFormProcessorController extends CI_Controller {
public function processForm() {
$selectedFolder = $this->input->post("mySelect");
$folderPath = "path/to/selected/".$selectedFolder;
}
}




Theme © iAndrew 2016 - Forum software by © MyBB