Web Design and Development Forums

Need help on code in firefox

This is a discussion on "Need help on code in firefox" within the JavaScript Forum section. This forum, and the thread "Need help on code in firefox are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > JavaScript Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 6th, 2008, 20:32   #1 (permalink)
New Member
 
Join Date: Apr 2008
Location: Kuwait
Age: 21
Posts: 3
Unhappy Need help on code in firefox

this code works great in every browser except firefox:-

Code: Select all
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

function validate() {

var theMessage = "Please complete the following: \n-----------------------------------\n";
var noErrors = theMessage

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.cpu.length; i++) {
if (document.form1.cpu[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Processor";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.mb.length; i++) {
if (document.form1.mb[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Motherbaord";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.hd.length; i++) {
if (document.form1.hd[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Hard disc";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.memory.length; i++) {
if (document.form1.memory[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your RAM";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.vga.length; i++) {
if (document.form1.vga[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Graphic card";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.CD.length; i++) {
if (document.form1.CD[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Optical Drive";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.PSU.length; i++) {
if (document.form1.PSU[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Power Supply Unit";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.cs.length; i++) {
if (document.form1.cs[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Cooling system";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.kase.length; i++) {
if (document.form1.kase[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Case";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.OS.length; i++) {
if (document.form1.OS[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Operating System";
}


// If no errors, submit the form
if (theMessage == noErrors) {
AddToCart(form1);

} else {

// If errors were found, show alert message
alert(theMessage);
return false;
}
}
// End -->
</script>
the validatetion works great in even in firefox its just dont get function AddToCart(form1); i dono why please help.
Giggs is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 7th, 2008, 12:24   #2 (permalink)
Moderator
 
spinal007's Avatar
 
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,609
Blog Entries: 1
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Need help on code in firefox

Do you mean AddToCart(form1); isn't executed?
__________________
Diego - SEO Consultant London (My Blog | Fight Me)
jQuery: Star Rating - Multiple File Upload - FCKEditor/Codepress
Before we work on artificial intelligence why don't we do something about natural stupidity?
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 7th, 2008, 16:48   #3 (permalink)
New Member
 
Join Date: Apr 2008
Location: Kuwait
Age: 21
Posts: 3
Re: Need help on code in firefox

yeah looks like form1 is not defined how do i do that?
and why dos it work on everything else exapt firefox
Giggs is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 7th, 2008, 16:59   #4 (permalink)
New Member
 
Join Date: Apr 2008
Location: Kuwait
Age: 21
Posts: 3
Re: Need help on code in firefox

did some reading AddToCart(document.forms['form1']); did the trick thanks
Giggs is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 9th, 2008, 05:21   #5 (permalink)
New Member
 
Join Date: Apr 2008
Location: Los Angeles, CA
Posts: 5
Re: Need help on code in firefox

Quote:
Originally Posted by Giggs View Post
this code works great in every browser except firefox:-

Code: Select all
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

function validate() {

var theMessage = "Please complete the following: \n-----------------------------------\n";
var noErrors = theMessage

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.cpu.length; i++) {
if (document.form1.cpu[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Processor";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.mb.length; i++) {
if (document.form1.mb[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Motherbaord";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.hd.length; i++) {
if (document.form1.hd[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Hard disc";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.memory.length; i++) {
if (document.form1.memory[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your RAM";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.vga.length; i++) {
if (document.form1.vga[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Graphic card";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.CD.length; i++) {
if (document.form1.CD[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Optical Drive";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.PSU.length; i++) {
if (document.form1.PSU[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Power Supply Unit";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.cs.length; i++) {
if (document.form1.cs[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Cooling system";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.kase.length; i++) {
if (document.form1.kase[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Case";
}

// make sure a radio button is selected
var radioCheck = false;
for (i = 0; i < document.form1.OS.length; i++) {
if (document.form1.OS[i].checked)
radioCheck = true; }
if (!radioCheck) {
theMessage = theMessage + "\n --> Choose your Operating System";
}


// If no errors, submit the form
if (theMessage == noErrors) {
AddToCart(form1);

} else {

// If errors were found, show alert message
alert(theMessage);
return false;
}
}
// End -->
</script>
the validatetion works great in even in firefox its just dont get function AddToCart(form1); i dono why please help.
I haven't had much luck with Firefox when it comes to JavaScript either.....
autodesigner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with code in Firefox psycho wolvesbane JavaScript Forum 2 Apr 6th, 2008 09:41
Extra code displaying in Firefox? Kreeyon HTML Forum 5 Apr 3rd, 2008 19:21
This code has problem in Firefox abalfazl HTML Forum 8 Feb 23rd, 2007 15:00
Javascript code ignored by Netscape/Firefox commodorejim JavaScript Forum 2 Oct 14th, 2006 10:13
Code not working on firefox acidblue0 HTML Forum 3 Jan 2nd, 2006 20:14



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 11:32.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59