Hi, I have three separate Javascripts in the header template for my site pages. One auto-fills a form field based on the value picked in a preceding field, the second is a date picker and the third is for sorting column values in a table output.
All work fine in isolation but I can’t get the three of them to work if they co-exist in the header. Any idea why/ I’m guessing there’s some form of conflict. At the moment the code is as below, and the date picker is the one that isn’t working for some reason. If I take the table sorter script away the date picker starts working. ???
<!--Auto selector for Clients / Suppliers list e.g on Add New Transaction -->
<script type="text/javascript">
$(function(){
$("select[name='_Category']").change(function(){
var selected = $(this).val();
$("select[name='_Name']").empty().load("getrowforselect.php?category="+selected);
});
});
</script>
<!--Date picker-->
<script type="text/javascript" >
$(function() {
$( "#datepicker1" ).datepicker({ dateFormat: "yy-mm-dd" });
$( "#datepicker2" ).datepicker({ dateFormat: "yy-mm-dd" });
$( "#datepicker3" ).datepicker({ dateFormat: "yy-mm-dd" });
$( "#datepicker4" ).datepicker({ dateFormat: "yy-mm-dd" });
$( "#datepicker5" ).datepicker({ dateFormat: "yy-mm-dd" });
$( "#datepicker6" ).datepicker({ dateFormat: "yy-mm-dd" });
$( "#datepicker7" ).datepicker({ dateFormat: "yy-mm-dd" });
$( "#datepicker8" ).datepicker({ dateFormat: "yy-mm-dd" });
});
</script>
<!--Script for sorting table columns-->
<script type="text/javascript" src="scripts/jquery-latest.js"></script>
<script type="text/javascript" src="scripts/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#invoices").tablesorter();
$("#quotations").tablesorter();
$("#clients").tablesorter();
$("#prospects").tablesorter();
$("#transactions").tablesorter();
$("#projects").tablesorter();
$("#jobs").tablesorter();
$("#contracts").tablesorter();
}
);
</script>