Hi guys i would like to ask how i can submit in codigniter the other value from html select list to the same column in the data base , for example .
I have this code in Html :
<selectid="major"class="formcontrol"name="f4"onchange='CheckColors(this.value);' required >
<option value="other">other</option>
</select>
<input type="text" name="f4" id="major" style='display:none;'/>
So when i click other another input show up (Javascript) ,
I need the value of the input field to be submit to data base to the same place , and not the value of the select :
And this is my model :
function insert_into_db()
{
$f1 = $_POST['f1'];
$f2 = $_POST['f2'];
$f3 = $_POST['f3'];
$f4 = $_POST['f4'];
$f5 = $_POST['f5'];
$f6 = $_POST['f6'];
$f7 = $_POST['f7'];
$f8 = $_POST['f8'];
$f9 = $_POST['f9'];
$this->db->query("INSERT INTO end VALUES('','$f1','$f2','$f3','$f4','$f5','$f6','$f7','$f8','$f9')");
}
the value f4 , i need to be submit from the select list if its selected , other wise it will be submitted from the input value , please any help ?