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

jprblue
@jprblue-JfSfz4 โ€ข Oct 21, 2024

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";
}

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Kaustubh Katdare

    @thebigk • Aug 27, 2012

    Tagging #-Link-Snipped-# & #-Link-Snipped-# . You guys know this stuff well ๐Ÿ˜€

  • PraveenKumar Purushothaman

    @praveenkumar-66Ze92 • Aug 27, 2012

    The innerHTML( is missing a colon there. It should be innerHTML('. And in the end, ');

  • jprblue
    jprblue OP

    @jprblue-JfSfz4 • Aug 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...

  • PraveenKumar Purushothaman

    @praveenkumar-66Ze92 • Aug 28, 2012

    jprblueOMG!!!!
    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! ๐Ÿ˜€

  • jprblue
    jprblue OP

    @jprblue-JfSfz4 • Aug 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..

    ๐Ÿ˜”

  • PraveenKumar Purushothaman

    @praveenkumar-66Ze92 • Aug 28, 2012

    jprbluemine 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.