Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 01-23-2008, 01:38 PM   #1
Member (9 bit)
 
ThePoor's Avatar
 
Join Date: Oct 2003
Location: NorthEastern USA
Posts: 369
Java Script help

Hi All,

I need some help, the code below only works with IE,
It's a form validation, Please help so it's also work with Firefox. If some1 using firefox they can just click on the "Continue with Application" buttion and get the file.

Thank you,


Code:
var checkedBox = new Image(); 
	blank = new Image();
    checkedBox.src = 'Images\/termError.gif';
	blank.src = 'Images\/termErrorBlank.gif';

function showImage(imagename, imageurl, errors) {
document[imagename].src = imageurl;
}

function validate()
		{		
			if (!(document.form1.Checkbox.checked)) 
			{
				showImage("Box", "Images/termError.gif", true)   // no semi-colon after this line!
				event.returnValue=false;
			}
			else
			{
				showImage("Box", "Images/termErrorBlank.gif", false); 	// true = errors, false = no errors
				event.returnValue=true;
			}
		}
Code:

I have read and agree to SMSA's terms.

or http://www.sportandmedicalsciences.o...pplication.htm
__________________
Fair isn't always equal.
ThePoor is offline   Reply With Quote
Old 01-23-2008, 08:59 PM   #2
Barefoot on the Moon!
Staff
Premium Member
 
Force Flow's Avatar
 
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
http://www.w3schools.com/js/js_form_validation.asp

Take a close look at that.

First, you need to change this line:
PHP Code:
<form name="form1" id="form1" method="get" action="SMSA Application.pdf" onClick="validate();"
use onSubmit, not onClick.

In the validate() function, you need to to a return true; or a return false;. These tell the form whether or not they can proceed with the form action.


Those are just the obvious things that popped out at me. I didn't check the rest of the code to see if those changes were the only things preventing it from working correctly.
__________________
There are two secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day, and you have to have a dream.

Last edited by Force Flow; 01-23-2008 at 09:01 PM.
Force Flow is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes 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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java script works but java applets won't lexi Windows Legacy Support (XP and earlier) 13 09-14-2003 07:11 AM
Looking for a java script Eaglefeather Internet, Web Applications, & The Cloud 13 01-16-2003 10:40 PM
Losing Java Script while editing a web page in Word Wanabe Web Design / Development 5 12-17-2001 02:15 PM
how to turn off Java script in IE5 Bobz Internet, Web Applications, & The Cloud 1 12-15-2001 07:01 PM
java script for pop-up window? ontoy Web Design / Development 0 09-24-2001 11:12 AM


All times are GMT -5. The time now is 07:34 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2