SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    validation works in IE not Firefox, why?

    I have the page where if you leave everything blank and click submit in IE and error box shows up, in firefox it ignores the validation and submits the page. why? making me crazy!!

    http://www.talkroot.com/registration.html
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It was your main function that was screwing up ....... you were trying to access the style with things like logError.style.visibility without using document.getElementById .. try this ..... works fine in both now!

    Code:
    function validateForm() {
    	if(document.getElementById('logError').style.visibility == "hidden" && document.getElementById('pwdError').style.visibility == "hidden" && document.getElementById('rePwdError').style.visibility == "hidden" && document.getElementById('emailError').style.visibility == "hidden" && document.getElementById('birthdayErr').style.visibility == "hidden")	{
    		return true;
    		}
    	else {
    		alert("There is missing or invalid data on the form");
    		return false;
    	}
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •