Forum Moderators: open
That's the script, and that's the tag of the form, up to what should matter....
What is going on, I keep getting an error(javascript error I believe) but since it's a form, I can't view the error, cause it loads the next page right away. The problem is the validate function isn't working. I'm validating that a radio button has been selected FCONTACT is the name of the radio button group. I can't influence the selection by automatically loading the page to select one, so I wrote a little function to check and see what was selected and if 1 was, return the value, if it wasn't return null...help...
*edit*
ewww, formatting of my code doesn't look that sloppy hehe...
OnSubmit="return validateForm[b]( form )"[/b] My guess is that changing ( form ) to ( this ) or ( document.forms[0] ) or something else that denotes an element in your code would fix this. In the code you have, I'd expect "form" to be the name of a JavaScript variable or the ID of your form. It doesn't seem to be either, which would mean you're passing a null value to your function.
hth,
g.
try {... } catch() {} statement can also be your best friend for hard-to-view errors...like... ...
// good code
try {
// evil, maleficent code spawned
// from the flames of tartarus
}
catch(e) {
alert(e);
}
...
Then you'll get a nice alert telling you the problem...like...'your code has taken to living in graveyards and sucking the blood of small rodents and flightless fowl; we think it's possessed' ;)
Jordan
javascript:try { alert(outofscopevar); } catch(e) { alert(e); }
In IE, though, it only alerts the object type "[object error]" and I'm not sure which attribute needs to be addressed to get the actual error message it shows with Opera / Mozilla.
Jordan