I have taken over a website that is way beyond my skill level but I have no choice but to learn, I have a contact form that gets validated by main.js and when submit is clicked nothing happens and there is an error on the bottom left of browser
Message: 'Job_productCat' is null or not an object
Line: 305
Char: 2
Code: 0
URI:
http://www.xxxx.com/main.js
Here is the section of code for the main.js (starting at line 302 to 348)
function checkCustRequestForm() {
var f = document.forms.custRequest;
var product = f['Job_productCat'].value;
var email = f['JobContact_email'].value;
var fName = f['JobContact_firstName'].value;
var reason = f['Job_note'].value;
if (fName == '') {
alert('Please enter your first name.');
return false;
}
if (email == '') {
alert('Please enter a valid email address so we can respond to your request.');
return false;
}
if (product == '- Please Select -') {
alert('Please select a Product Category most closely associated with your request.');
return false;
}
if (reason == '') {
alert('Please enter your request in the Reason for Contact area');
return false;
}
return true;
}
function checkContactForm() {
var f = document.forms['contactForm'];
var theName = f['ContactRequest_name'].value;
var theCompany = f['ContactRequest_companyName'].value;
var theInfo = f['ContactRequest_contactInfo'].value;
if (theName == '' || theCompany == '' || theInfo == '') {
alert('Please enter at least your name, company name, and phone number.');
return false;
}
return true;
}
I would be so greatful for any and all help.
Thanks
Trevor