IE/Avast against Netscape/Mozilla problem

Discussion in 'HTML' started by Rg, Aug 13, 2004.

  1. Rg

    Rg Guest

    Hello,
    I wrote a minimal page to test browsers.
    This displays 2 checkboxes and with java scripting
    second checkbox should reflect changes made in the
    first one. This works perfectly in internet explorer
    and avast browser but it is like a non-scripted
    page in netscape and mozilla.
    Can somebody tell me what to write to enable scripting
    in all browsers.
    Thanks in advance.


    <html>
    <head></head>
    <body>
    <form id="Doc" name="Doc">
    <input type="checkbox" name="Chk1" id="Chk1" onClick="Chk1Cliqued()">1
    <BR>
    <input type="checkbox" name="Chk2" id="Chk2" >2<BR>
    </form>
    </body>
    <script LANGUAGE="JavaScript">
    <!--
    void function Chk1Cliqued() {
    document.Doc.Chk2.checked=document.Doc.Chk1.checked;
    }
    -->
    </script>
    </html>
    Rg, Aug 13, 2004
    #1
    1. Advertising

  2. Rg

    Jim Higson Guest

    Rg wrote:

    > Hello,
    > I wrote a minimal page to test browsers.
    > This displays 2 checkboxes and with java scripting
    > second checkbox should reflect changes made in the
    > first one. This works perfectly in internet explorer
    > and avast browser but it is like a non-scripted
    > page in netscape and mozilla.
    > Can somebody tell me what to write to enable scripting
    > in all browsers.
    > Thanks in advance.
    >
    >
    > <html>
    > <head></head>
    > <body>
    > <form id="Doc" name="Doc">
    > <input type="checkbox" name="Chk1" id="Chk1" onClick="Chk1Cliqued()">1
    > <BR>
    > <input type="checkbox" name="Chk2" id="Chk2" >2<BR>
    > </form>
    > </body>
    > <script LANGUAGE="JavaScript">
    > <!--
    > void function Chk1Cliqued() {
    > document.Doc.Chk2.checked=document.Doc.Chk1.checked;


    Follow the javascript standards, here that means getting the element via
    Document.getElementById.
    Jim Higson, Aug 13, 2004
    #2
    1. Advertising

  3. Rg

    C A Upsdell Guest

    "Jim Higson" <> wrote in message
    news:...
    > Rg wrote:
    >
    > > Hello,
    > > I wrote a minimal page to test browsers.
    > > This displays 2 checkboxes and with java scripting
    > > second checkbox should reflect changes made in the
    > > first one. This works perfectly in internet explorer
    > > and avast browser but it is like a non-scripted
    > > page in netscape and mozilla.

    >
    > Follow the javascript standards, here that means getting the element via
    > Document.getElementById.


    I find this function useful to return the object associated with an id, as
    it works with older versions of IE as well:

    // getObject - get object associated with an ID, or null if no object
    function getObject ( id )
    {
    if ( id == "" )
    return( null );
    if ( document.getElementById && (obj =
    document.getElementById(id)) )
    ;
    else if ( document.all && (obj = document.all[id]) )
    ;
    else /* DOM not supported, or no object */
    return( null );
    return( obj );
    }
    C A Upsdell, Aug 13, 2004
    #3
  4. Rg

    Rg Guest

    thank you -> it's done.
    Rg, Aug 15, 2004
    #4
  5. Rg

    WebcastMaker Guest

    In article <Xns9546546751306spammeagain@205.237.233.52>, n
    says...
    > thank you -> it's done.


    phew.... We were worried abut this...
    --
    WebcastMaker
    Webcasting for free
    http://www.webentations.com
    WebcastMaker, Aug 15, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    0
    Views:
    490
  2. Mickey Segal
    Replies:
    1
    Views:
    657
    Mickey Segal
    May 21, 2004
  3. Damaeus
    Replies:
    3
    Views:
    537
    Blinky the Shark
    Jul 22, 2004
  4. Replies:
    3
    Views:
    407
    ExGuardianReader
    Jan 8, 2005
  5. GD
    Replies:
    6
    Views:
    121
Loading...

Share This Page