Code works in IE but not Netscape/Mozilla

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Keegan Alex

    Code works in IE but not Netscape/Mozilla

    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.getEle mentById("EmpAs terisk1").style .visibility =
    "visible";
    }
    function EmployedN() {
    document.getEle mentById("EmpAs terisk1").style .visibility = "hidden";
    }
    </script>

    ....snip...

    Are you employed?
    <INPUT TYPE="RADIO" NAME="EmployedY esNo" VALUE="Yes"
    onclick="employ edY()"> Yes
    <INPUT TYPE="RADIO" NAME="EmployedY esNo" VALUE="No"
    onclick="Employ edN()" checked> No

    <span id="EmpAsterisk 1" style="visibili ty:hidden;"><fo nt size="4"
    color="#FF0000# "><b>*</b></font></span>
    Employer:<INPUT TYPE="TEXT" NAME="Employer" >

    ....snip...
  • Janwillem Borleffs

    #2
    Re: Code works in IE but not Netscape/Mozilla


    "Keegan Alex" <keeganalex@yah oo.com> wrote in message
    news:d815f41a.0 307300427.6a1b4 026@posting.goo gle.com...[color=blue]
    > 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.
    >[/color]
    .....[color=blue]
    >
    > <span id="EmpAsterisk 1" style="visibili ty:hidden;"><fo nt size="4"
    > color="#FF0000# "><b>*</b></font></span>
    > Employer:<INPUT TYPE="TEXT" NAME="Employer" >
    >[/color]

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

    <span id="EmpAsterisk 1"

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

    Or better yet:

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


    JW



    Comment

    Working...