2014-02-12 70 views
0

这是我的index.html。我想在按钮被点击checklogin.php时做出动作。这是我做的,但它显示按钮上的文本。我应该在哪里粘贴我的动作?任何人都可以给我一个建议吗?如何将按钮动作按钮

<html> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    <link rel="stylesheet" type="text/css" href="logs.css" /> 
</head> 

<body> 
    <div class="container"> 
     <form id="signup"> 
      <div class="header"> 
       <h3>Logowanie</h3> 

      </div> 
      <div class="sep"></div> 
      <div class="inputs"> 
       <input type="myusername" placeholder="Login" autofocus /> 
       <input type="mypassword" placeholder="Hasło" /> <a id="submit"> 
      <form name="form1" method="post" action="check.php"> 
      <input type="submit" name="Submit" value="OK"> </form> Zaloguj </a> 

      </div> 
     </form> 
    </div> 
</body> 
</html> 

这里是我的CSS:

#signup .inputs #submit { 
    width: 100%; 
    margin-top: 20px; 
    padding: 15px 0; 
    color: #fff; 
    font-size: 14px; 
    font-weight: 500; 
    letter-spacing: 1px; 
    text-align: center; 
    text-decoration: none; 
    background: -moz-linear-gradient(top, #b9c5dd 0%, #a4b0cb); 
    background: -webkit-gradient(linear, left top, left bottom, from(#b9c5dd), to(#a4b0cb)); 
    -moz-border-radius: 5px; 
    -webkit-border-radius: 5px; 
    border-radius: 5px; 
    border: 1px solid #737b8d; 
    -moz-box-shadow: 0px 5px 5px rgba(000, 000, 000, 0.1), inset 0px 1px 0px rgba(255, 255, 255, 0.5); 
    -webkit-box-shadow: 0px 5px 5px rgba(000, 000, 000, 0.1), inset 0px 1px 0px rgba(255, 255, 255, 0.5); 
    box-shadow: 0px 5px 5px rgba(000, 000, 000, 0.1), inset 0px 1px 0px rgba(255, 255, 255, 0.5); 
    text-shadow: 0px 1px 3px rgba(000, 000, 000, 0.3), 0px 0px 0px rgba(255, 255, 255, 0); 
    display: table; 
    position: static; 
    clear: both; 
} 
+0

你有太多的表单标签。而你的A标签是非法的。那里是checklogin.php?那是为了测试登录名是否有效?请重写你的问题 – mplungjan

+0

@mplungjan是的,chcecklogin是验证登录过程。我想为这个大按钮动一针,没有别的 – user3299430

+0

@mplungjan看看这个,http://jsfiddle.net/9mCuJ/ – user3299430

回答

0

Live Demo

首先这里是有效的HTML

<div class="container"> 
    <form name="form1" method="post" action="check.php"> 
    <div class="header"> 
     <h3>Logowanie</h3> 
    </div> 
    <div class="sep"></div> 
    <div class="inputs"> 
     <input type="myusername" placeholder="Login" autofocus /> 
     <input type="mypassword" placeholder="Hasło" /> 
     <a id="submit" href="#">Zaloguj </a> 
    </div> 
    </form> 
</div> 

其次,如果你需要的电缆铺设工作环节,做到这一点

window.onload=function() { 
    document.getElementById("submit").onclick=function() { 
    document.form1.submit(); 
    return false; 
    } 
} 

第三,你只需要这在CSS

#submit {