CrazyEngineers
  • Javascript codes: working only on Firefox...:( Can anyone search for errors plz..

    jprblue

    jprblue

    @jprblue-JfSfz4
    Updated: Aug 27, 2012
    Views: 1.5K
    home.html
    <html>
    <head>
    <title>Home</title>
    <script language="javascript" type="text/javascript" src="javascripts.js"></script>
    <style type="text/css">
    #login
    {
    background-color:#336699;
    display:none;
    border:2px solid;
    border-radius:25px;
    -moz-border-radius:25px;
    -webkit-border-radius:25px;
    -o-border-radius:25px;
    -ms-border-radius:25px;
    }
    #div1
    {
    float:right;
    }
    #button1
    {
    background-color:#CCFF33;
    border:2px solid;
    border-radius:25px;
    -moz-border-radius:25px;
    -webkit-border-radius:25px;
    -o-border-radius:25px;
    -ms-border-radius:25px;
    }
    </style>
    </head>
    <body>
    <span id="login" ></span>
    <div id="div1">
    <button id="button1" onclick="showhide(); login();">Login or SignUp</button>
    </div>

    </body>
    </html>


    javascript.js
    function login()
    {
    document.getElementById('login').innerHTML=(
    <table border="0" style="color:white;">
    <tr>
    <td>Your name or email address:</td>
    <td><input type="text" name="txt_uname"/></td>
    <td></td>
    </tr>
    <tr>
    <td>Do you already have an account?</td>
    <td><input type="radio" name="radio" onclick="create()"/>No, create an account now.</td>
    </tr>
    <tr>
    <td></td>
    <td><input type="radio" name="radio" onclick="normal()"/>Yes, my password is:</td>
    </tr>
    <tr>
    <td></td>
    <td><input type="password" name="txt_password" id="txt_password"/></td>
    </tr>
    <tr>
    <td></td>
    <td><input type="submit" value="Log in" id="submit"/></td>
    </tr>
    </table>);
    }
    function showhide()
    {
    if(document.getElementById('login').style.display == "block")
    document.getElementById('login').style.display = "none";
    else
    document.getElementById('login').style.display = "block";
    }
    function create()
    {
    document.getElementById('txt_password').style.display = "none";
    document.getElementById('submit').value="Sign up";
    }
    function normal()
    {
    document.getElementById('txt_password').style.display = "block";
    document.getElementById('submit').value="Log in";
    }
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Kaustubh Katdare

    AdministratorAug 27, 2012

    Tagging #-Link-Snipped-# & #-Link-Snipped-# . You guys know this stuff well 😀
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberAug 27, 2012

    The innerHTML( is missing a colon there. It should be innerHTML('. And in the end, ');
    Are you sure? This action cannot be undone.
    Cancel
  • jprblue

    MemberAug 28, 2012

    OMG!!!!
    its working...
    Great..
    thanks a lot..... 😉
    but my rounded corners are not working on IE....
    it is appearing like a rectangle there...
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberAug 28, 2012

    jprblue
    OMG!!!!
    its working...
    Great..
    thanks a lot..... 😉
    but my rounded corners are not working on IE....
    it is appearing like a rectangle there...
    Rounded Corners doesn't work with IE 8 and below. You can use <a href="https://css3pie.com/" target="_blank" rel="nofollow noopener noreferrer">css3pie.com</a> for that! 😀
    Are you sure? This action cannot be undone.
    Cancel
  • jprblue

    MemberAug 28, 2012

    mine is IE9... it works... but when the span appears.. the button's css does not move along with the button... its color and borders remain at the top.. Result: u'll see the span overlapping over the rounded corners border..

    😔
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberAug 28, 2012

    jprblue
    mine is IE9... it works... but when the span appears.. the button's css does not move along with the button... its color and borders remain at the top.. Result: u'll see the span overlapping over the rounded corners border..

    😔
    Give overflow: hidden; to the element, which has border-radius.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register