I have a drop down menu with dynamically set values from the database:
When a value is selected how could I make it load a specific view dependent on what the selected option is?
I now have it loading a specific view dependent on what option is selected:
Code:
if (isset($_REQUEST['general_options'])) {
$page = strtolower(str_replace(" ", "", $_REQUEST['general_options']));
$this->load->view( $page, $data, FALSE);
}
How could I dynamically produce a form with specific questions dependent on what question is selected?
HTML:
<label for="general_options">Quote Type: </label>
<select name="general_options" id="general_options">
<option value="Graphic Design">Graphic Design</option>
<option value="Content Management System">Content Management System</option>
<option value="Shopping Cart">Shopping Cart</option>
<option value="E-Mail Marketing">E-Mail Marketing</option>
</select>
I think php will be overkill for this. I have used jquery for this. you can find the jsfiddle here
and the jquery Code