Jump to content

[SOLVED] Validation onSubmit script not working in IE6


pquery

Recommended Posts

Hi, I' wrote this validation script for my new program which I was getting people to test in one of the other forum, but it seems like the validation isn't working on IE 6 for some reason. In FF it's working fine and I haven't had a chance to test in IE 7 just yet but I'm just not sure why if my form method is name="profileMaker" id="profileMaker" action="###" onsubmit="return validateForm()" method="post" and my js function is called

 

function validateForm() {

with (document.profileMaker)

 

why it would just skip over everything in IE, there's other onClick actions on the page which are working fine.

 

???any help is appreciated.  http://freeprofile.pquery.com

Link to comment
Share on other sites

Hmmm,

 

I implimented you fix, but still got the same results... I got reaction from FF but no validation / reaction  from IE 6

 

What's strange is that on this page I have a js which is running the tabber which shows the hidden divs so it's just this onsubmit function.

 

 

thanks for your suggestion though.

 

anyone else have any suggestions?

Link to comment
Share on other sites

I have actually solved this and I am going to post the solution for anyone else that runs into this issue...

 

the problem wasn't in my initial onsubmit() statement at all, tather it was with the fact that in my validator code that on one of my check functions I had a statement that was using the same veriable names as the names of the dropdown lists that it was checking against each other.

 

here is the original statement:

 

// checking that max age isn't less then min age

 

maxAge = document.profileMaker.elements.maxAge.value

minAge = document.profileMaker.elements.minAge.value

 

if (maxAge <= minAge) {

alertMsg += "\nThe Minimum age can't be more then the max (Looking For)"

}

 

and the dropdown list(s) input lines only from the code

 

<select size="1"  name="minAge">

<select size="1"  name="maxAge">

 

now here's the fix ~ notice how I put the n at the end of the variable names so that it works now in IE6

// checking that max age isn't less then min age

 

maxAgen = document.profileMaker.elements.maxAge.value

minAgen = document.profileMaker.elements.minAge.value

 

if (maxAgen <= minAgen) {

alertMsg += "\nThe Minimum age can't be more then the max (Looking For)"

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.