|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (9 bit)
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:
__________________
Fair isn't always equal. |
|
|
|
|
|
#2 |
|
Barefoot on the Moon!
Staff
Premium Member
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:
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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
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 |