06-06-2016, 02:36 AM
On my Ci view I have a drop down list for mysqli and pdo
A few lines down that view I have another form group that has my database port input
I would like to know how to hide the div below until I click on the pdo option on my select form and if I select mysqli it will hide it etc
PHP Code:
<div class="form-group">
<label class="col-lg-3">Database Driver</label>
<div class="col-lg-9">
<select name="database_driver" class="form-control">
<option value="">Select a Type</option>
<option value="mysqli">mysqli</option>
<option value="pdo" id="database_driver_pdo">pdo</option>
</select>
<?php echo form_error('database_driver', '<br/><div class="text-danger">', '</div>'); ?>
</div>
</div>
A few lines down that view I have another form group that has my database port input
PHP Code:
<div class="form-group" id="database_port">
<label class="col-lg-3">Database Port</label>
<div class="col-lg-9">
<input type="text" name="database_port" class="form-control" placeholder="Database Port: Leave this blank if not required" />
</div>
</div>
I would like to know how to hide the div below until I click on the pdo option on my select form and if I select mysqli it will hide it etc
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!