$(function() { $('a.confirm'). click(function() { if (!confirm($(this).attr('title'))) { return false; } }); $option_selected = $('#dblayer').attr('value'); if ($option_selected=='sqlite' || $option_selected=='pdo-sqlite') { $('input[name=db_host],input[name=db_user],input[name=db_password]').parent().parent().hide(); } $('#dblayer').change(function() { $db = this; if ($db.value=='sqlite' || $db.value=='pdo-sqlite') { $('input[name=db_host],input[name=db_user],input[name=db_password]').parent().parent().hide(); } else { $('input[name=db_host],input[name=db_user],input[name=db_password]').parent().parent().show(); } }); });