Onclick problem

windows

Guest
I have a HTML form in Netscape 4 that calls a Javascript Function and it works great but after I put in the <ilayer> to hide the form object it seems to ignore the onclick return myFunction. Basically after I add the <ilayer> it eliminates the onclick event for the "MyFunction" part. Is there something I can do to get "myFunction" to work in the onclick event with <ilayer>?? <br />
The MyFunction() is validating form data entry. The form still works with <ilayer> but it ignores the MyFunction. The weird part is the OnClick works if I take out the <ilayer> part. <br />
<br />
I have tried many many ways of doing this with NO luck at all. Here is a couple of the attempts: <br />
<br />
//first attempt <br />
<script> <br />
function myFunction() <br />
{ <br />
var fm = (document.layers) ? document.tt.document.form5 : document.form5; <br />
if(document.form5.announcement_cd.options[document.form5.announcement_cd.selectedIndex].value == "None" <br />
) <br />
{ <br />
alert("Select one option to continue."); <br />
return false; <br />
} <br />
} <br />
</script> <br />
<br />
<ilayer id="tt"> <br />
<FORM name="form5" action="form5.cfm"> <br />
<INPUT TYPE="button" VALUE="Help"> <br />
<SELECT NAME="announcement_cd"> <br />
<OPTION VALUE="None" SELECTED>Select Options:</OPTION> <br />
<OPTION VALUE="test">test</OPTION> <br />
</SELECT> <br />
<input type="submit" value="Select" onclick="return myFunction()"> <br />
</form> <br />
</ilayer> <br />
<br />
<br />
====== <br />
\\Another attempt: <br />
<br />
<br />
<script> <br />
function myFunction(fm) <br />
{ <br />
if(fm.announcement_cd.options[fm.announcement_cd.selectedIndex].value == "None") <br />
{ <br />
alert("Select one option to continue."); <br />
return false; <br />
} <br />
} <br />
<br />
</script> <br />
<ilayer id="tt"> <br />
<FORM name="form5" action="form5.cfm"> <br />
<INPUT TYPE="button" VALUE="Help"> <br />
<SELECT NAME="announcement_cd"> <br />
<OPTION VALUE="None" SELECTED>Select Options:</OPTION> <br />
<OPTION VALUE="test">test</OPTION> <br />
</SELECT> <br />
<input type="submit" value="Select" onclick="return myFunction(this.form)"> <br />
</form> <br />
</ilayer> <br />
<br />
<br />
////Here is the layer "tt" used to hide the form which is located in my pop up javascript in a javascript file. Again,<br />
this part does work great with <ilayer> but the <ilayer> seems to ignore my onclick myFunction part that validates<br />
my data. The document does hide but the validation function on my "onclick="return myFunction(this.form)" doesnt<br />
want to work. <br />
<br />
if(document.layers) <br />
{ <br />
document.tt.visibility = "hide"; <br />
}<!--content-->the ilayer only works in NN4, why don't you use a DIV instead, see if it works with that<!--content-->I tried <div> and it didnt work in Netscape 4. Any other suggestions?<!--content-->i hate that. span works in one, div works in the other. im not sure, sorry!<!--content-->
 
Back
Top