I have a bit of javascript that I am trying to untangle, it's on a PHP form to calculate mortgage repayments, but clicking the calculate button does nothing.
Looking at Chrome Console I get the message
Uncaught TypeError: Undefined is not a function" on line 10($("#form_7") to 19
of the following code.
<script type="text/javascript">
$(document).ready(function() {
$("a.ActiveButton").bind({
mousedown:function(){
if ($(this).attr('disabled') === undefined )
$(this).addClass('Activated');
},
mouseleave:function(){
if ($(this).attr('disabled') === undefined )
$(this).removeClass('Activated');
},
mouseup:function(){
if ($(this).attr('disabled') === undefined )
$(this).removeClass('Activated');
}
});
$("#form_7").validate({
onkeyup: false,
showErrors: function(errorMap, errorList) {
if (errorList.length) alert(errorList[0].message);
},
onclick: false,
rules: {
'Property_Price': { number: true } ,
'Deposit': { number: true } ,
'Duration': { number: true } ,
'InterestRate': { number: true }
},
onfocusout: false,
messages: {
'Property_Price': { number: "Please enter the property purchase price." } ,
'Deposit': { number: "Please enter your deposit amount or 0 if there is no deposit." } ,
'Duration': { number: "Please enter the duration of the mortgage." } ,
'InterestRate': { number: "Please enter the mortgage interest rate." }
}
});
$('#btn_4').click( function(){validate_form_7( form_7 )});
});
</script>
Does anyone know what is causing this error and how it can resolved?