2014-02-12 110 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 {