Code works in IE but not Netscape/Mozilla

K

Keegan Alex

Hello,

I'm writing a form where it puts a red asterisk next to required
fields, and depending on a few Yes/No questions, the asterisks will
change. This works great in IE but not in Netscape or Mozilla. Can
someone give me pointers on what's going wrong? Below is a sample of
the code for one entry.

I stripped out all the formatting and unneeded code since the form
this is from is over 1200 lines.

Thanks for any suggestions.

Keegan.

....snip...

<script type="text/javascript">
function employedY() {
document.getElementById("EmpAsterisk1").style.visibility =
"visible";
}
function EmployedN() {
document.getElementById("EmpAsterisk1").style.visibility = "hidden";
}
</script>

....snip...

Are you employed?
<INPUT TYPE="RADIO" NAME="EmployedYesNo" VALUE="Yes"
onclick="employedY()"> Yes
<INPUT TYPE="RADIO" NAME="EmployedYesNo" VALUE="No"
onclick="EmployedN()" checked> No

<span id="EmpAsterisk1" style="visibility:hidden;"><font size="4"
color="#FF0000#"><b>*</b></font></span>
Employer:<INPUT TYPE="TEXT" NAME="Employer">

....snip...
 
J

Janwillem Borleffs

Keegan Alex said:
Hello,

I'm writing a form where it puts a red asterisk next to required
fields, and depending on a few Yes/No questions, the asterisks will
change. This works great in IE but not in Netscape or Mozilla. Can
someone give me pointers on what's going wrong? Below is a sample of
the code for one entry.
.....

<span id="EmpAsterisk1" style="visibility:hidden;"><font size="4"
color="#FF0000#"><b>*</b></font></span>
Employer:<INPUT TYPE="TEXT" NAME="Employer">

No problems on my system, but you shouldn't mix font and b tags with css.
Just do:

<span id="EmpAsterisk1"

style="visibility:hidden;font-size:12px;color:#ff0000;font-weight:bold">*</s
pan>

Or better yet:

<style type="text/css">
#EmpAsterisk1 {
visibility:hidden;font-size:12px;color:#ff0000;font-weight:bold }
</style>
.....
<span id="EmpAsterisk1">*</span>


JW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top