Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/423.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用不起作用的按钮显示和隐藏_Javascript_Php_Jquery_Button_Show Hide - Fatal编程技术网

Javascript 使用不起作用的按钮显示和隐藏

Javascript 使用不起作用的按钮显示和隐藏,javascript,php,jquery,button,show-hide,Javascript,Php,Jquery,Button,Show Hide,好吧,我一直在试图修复这个代码,并搜索它超过6个小时,这是杀死我 我试图做的是隐藏登录表和与之相关的背景图像(即#lg#ck),并在登录表的顶部放置一个按钮,因此当单击它时,它将显示登录表 <?php require_once( 'inc/header.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'db.inc.p

好吧,我一直在试图修复这个代码,并搜索它超过6个小时,这是杀死我

我试图做的是隐藏登录表和与之相关的背景图像(即#lg#ck),并在登录表的顶部放置一个按钮,因此当单击它时,它将显示登录表

<?php

require_once( 'inc/header.inc.php' );

require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );

require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' );

require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );


check_logged();

if(!isMember()) {
echo '<body style="margin:0;">

<div style="margin:0 auto" align=center>

    <form onsubmit="validateLoginForm(this); return false;" method="post" action="member.php" id="login_box_form">

        <table id="ck">

            <tbody>

                <tr>
                    <td width="180">Name</td>

                    <td width="150">Code</td>

                    <td width="50">&nbsp;</td>
                </tr>
                <tr>
                    <td width="180"><input style="width:180px;" name="ID" type="text"></td>

                    <td width="180"><input style="width:180px;"name="Password" type="password"></td>

                    <td><input name="LogIn" type="submit" tabindex="3" value="Login"></td>

                </tr>

                <tr>
                    <td width="180"><input type="checkbox" name="rememberMe"> Keep me logged in</td>

                    <td width="180"><a href="forgot.php">Forgot password?</a></td>

                    <td width="50">&nbsp;</td>

                </tr>

            </tbody>

        </table>

    </form>

</div>

<div style="width:100%;height:20px;clear:both;"></div>

<div style="width:100%;height:600px;padding-left:40px;padding-right:40px;padding-top:20px;">';

}

else {
header("Location: index.php");
}

?>
<!DOCTYPE html>
<html>
<head>
<title>Nox's Ark</title>
</head>
<body id="lg"> <p class="bt"></p>
</div>
</p>
<style media="screen" type="text/css">

html { 
  background: url(../img/bil.jpg)no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  overflow:hidden;

}
#ck {
    width:450px; 
    border: 5px; 
    align:center; 
    cellpadding= 0px; 
    cellspacing= 1px; 
    padding-left:1100px;
    padding-top:500px; 

    }
#lg {
    background-image:url(../img/nbt.png);
    background-repeat:no-repeat;
    background-position: 1220px 380px;
    }
.bt {


</style>

</body>
</html>

<?php


?>

我要做的是:

<div id="ONE"><input type="button" value="Login" onClick="hideID('ONE');showID('TWO');" /></div>
<div id="TWO" style="display:none"><table cellspacing="0" cellpadding="0" align="center"><tr><td colspan="2"><h1>Login</h1></td></tr><tr><td>password:</td><td><input type="text" /></td></tr><tr><td>username:</td><td><input type="text" /></td></tr><tr><td colspan="2"><input type="submit" value="login" /></td></tr></table></div>

希望有帮助

请发布您的代码,而不是画一个笑脸。我知道您正在尝试做什么,但目前正在发生什么?没有发生任何事情,因为当我放置代码时,会出现一个登录框,但单击它时不会执行任何操作。嗨!谢谢你这么快的回复:D!!但是我应该把它放在哪里呢?js或者任何地方,我试着把所有的东西都放在头上,但它只显示了登录按钮,什么也没做。上一个登录表仍然存在,单击它时不会发生任何事情。
`<?php

require_once( 'inc/header.inc.php' );

require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );

require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' );

require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );


check_logged();

if(!isMember()) {
echo '<body style="margin:0;">

<div style="margin:0 auto" align=center>

    <form onsubmit="validateLoginForm(this); return false;" method="post" action="member.php" id="login_box_form">

        <table id="ck">

            <tbody>

                <tr>
                    <td width="180">Name</td>

                    <td width="150">Code</td>

                    <td width="50">&nbsp;</td>
                </tr>
                <tr>
                    <td width="180"><input style="width:180px;" name="ID" type="text"></td>

                    <td width="180"><input style="width:180px;"name="Password" type="password"></td>

                    <td><input name="LogIn" type="submit" tabindex="3" value="Login"></td>

                </tr>

                <tr>
                    <td width="180"><input type="checkbox" name="rememberMe"> Keep me logged in</td>

                    <td width="180"><a href="forgot.php">Forgot password?</a></td>

                    <td width="50">&nbsp;</td>

                </tr>

            </tbody>

        </table>

    </form>

</div>

<div style="width:100%;height:20px;clear:both;"></div>

<div style="width:100%;height:600px;padding-left:40px;padding-right:40px;padding-top:20px;">';

}

else {
header("Location: index.php");
}

?>
<!DOCTYPE html>
<html>
<head>
<title>Nox's Ark</title><div id="ONE"><input type="button" value="Login" onClick="hideID('ONE');showID('TWO');" /></div>
<div id="TWO" style="display:none"><table cellspacing="0" cellpadding="0" align="center"><tr><td colspan="2"><h1>Login</h1></td></tr><tr><td>password:</td><td><input type="text" /></td></tr><tr><td>username:</td><td><input type="text" /></td></tr><tr><td colspan="2"><input type="submit" value="login" /></td></tr></table></div><script>function hideID(objID) {
    var element = (ie) ? document.all(objID) : document.getElementById(objID);
    element.style.display = "none";
}

function showID(objID) {
    var element = (ie) ? document.all(objID) : document.getElementById(objID);
    element.style.display = "block";
}</script>
</head>
<body id="lg"> <p class="bt"></p>
</div>
</p>
<style media="screen" type="text/css">

html { 
  background: url(../img/bil.jpg)no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  overflow:hidden;

}
#ck {
    width:450px; 
    border: 5px; 
    align:center; 
    cellpadding= 0px; 
    cellspacing= 1px; 
    padding-left:1100px;
    padding-top:500px; 

    }
#lg {
    background-image:url(../img/nbt.png);
    background-repeat:no-repeat;
    background-position: 1220px 380px;
    }
.bt {


</style>

</body>
</html>

<?php


?>`
<div id="ONE"><input type="button" value="Login" onClick="hideID('ONE');showID('TWO');" /></div>
<div id="TWO" style="display:none"><table cellspacing="0" cellpadding="0" align="center"><tr><td colspan="2"><h1>Login</h1></td></tr><tr><td>password:</td><td><input type="text" /></td></tr><tr><td>username:</td><td><input type="text" /></td></tr><tr><td colspan="2"><input type="submit" value="login" /></td></tr></table></div>
function hideID(objID) {
    var element = (ie) ? document.all(objID) : document.getElementById(objID);
    element.style.display = "none";
}

function showID(objID) {
    var element = (ie) ? document.all(objID) : document.getElementById(objID);
    element.style.display = "block";
}