Hide Form Group Until Select Item |
On my Ci view I have a drop down list for mysqli and pdo
PHP Code: <div class="form-group"> 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"> 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!
Hide / Show Div
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
If you would use jQuery it would be as simple as this:
Code: $('[name="database_driver"]').change(function(){ Of course, you would need to start with #database_port hidden, so just use CSS for that. |
Welcome Guest, Not a member yet? Register Sign In |