pquery Posted December 25, 2007 Share Posted December 25, 2007 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 Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 26, 2007 Share Posted December 26, 2007 try onsubmit="return validateForm(this)" and then function validateForm(frm) { with (frm) Quote Link to comment Share on other sites More sharing options...
pquery Posted December 26, 2007 Author Share Posted December 26, 2007 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? Quote Link to comment Share on other sites More sharing options...
pquery Posted December 26, 2007 Author Share Posted December 26, 2007 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)" } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.