Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Easy Js question. I think
Old 01-13-2010, 11:52 AM Easy Js question. I think
Junior Talker

Posts: 2
Name: trevor
Trades: 0
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
logicsound is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-13-2010, 03:11 PM Re: Easy Js question. I think
Junior Talker

Posts: 2
Name: trevor
Trades: 0
anybody? If I need to post something else, Let me know...I really need some help!!!!
logicsound is offline
Reply With Quote
View Public Profile
 
Old 01-13-2010, 03:55 PM Re: Easy Js question. I think
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
If I need to post something else
Yep.
The HTML.

Better still a URI.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-13-2010, 05:02 PM Re: Easy Js question. I think
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
My guess is that 'Job_productCat' is a <select>.
To get the value of a select, in a cross browser way, you must use:
Code:
var product = f['Job_productCat'].options[f['Job_productCat'].selectedIndex].value;
The f['Job_productCat'].value works only in IE, as far as I know.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Easy Js question. I think
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.48802 seconds with 12 queries