This javascript worked before but just today, it doesn't. I tried adding alert() inside the functions.js but it doesn't pop up anymore. My javascript is enabled and pop up is enabled, too.
footer.php
<script type="text/javascript" src="<?php echo site_url('assets/js/jquery/jquery-1.11.0.min.js') ?>"></script>
<script type="text/javascript" src="<?php echo site_url('assets/js/jquery/functions.js') ?>"></script>
<script type="text/javascript" src="<?php echo site_url('assets/js/jquery/jquery.validate.js') ?>"></script>
<script type="text/javascript" src="<?php echo site_url('assets/js/jquery/additional-methods.js') ?>"></script>
functions.js
$("document").ready(function(){
alert("sfs");
$('#type').change(function () {
if ($('#type').val() == 'fund') {
$('#fund').show();
$('#submit').show();
} else if ($('#type').val() == 'attendance') {
$('#fund').hide();
$('#submit').show();
} else {
$('#fund').hide();
$('#submit').hide();
}
});
$("addmember").validate({
rules: {
id: {
required: true,
digits: true
}
lname: {
required: true
}
fname: {
required: true
}
mname: {
required: true
}
contact: {
digits: true
}
email: {
email: true
}
}
});
});
tnew.php
<div id="content">
<center>
<h1>New Transaction</h1>
<?php echo form_open("home/transact"); ?>
<table>
<tbody>
<tr>
<td>Name:</td>
<td><input type="text" placeholder="Transaction" name="name" id="name" required/></td>
</tr>
<tr>
<td>Type:</td>
<td><?php
$options = array(
'select' => '(Select Type)',
'fund' => 'Funds',
'attendance' => 'Attendance'
);
$id = 'id = "type"';
echo form_dropdown('type', $options, 'select', $id);
?>
</td>
</tr>
<tr id="fund" style="display: none;">
<td>Amount: </td>
<td><input type="number" placeholder="Amount" name="amt" id="amt" /></td>
</tr>
<tr id="submit" style="display: none;">
<td colspan = 2><?php echo form_submit("submit", "Add Transaction"); ?></td>
</tr>
</tbody>
</table>
</center>
Dropdown used to work but now, it doesn't. I'm also using codeigniter if that's an issue.