2013-08-05 58 views
0

我用CSS模板下载了一个html。在登录表单(其中最初被蓝色按钮CSS的作品。我复制的按钮相同的HTML代码到另一个区域,当我点击它不工作。

CSS

.blue-button { 
    display: inline-block; 
    vertical-align: top; 
    border: solid 1px #6d8794; 
    position: relative; 
    border: solid 1px #6d8794; 
    -moz-border-radius: 4px; 
    -webkit-border-radius: 4px; 
    border-radius: 4px; 
    behavior: url(css/PIE.php); 
} 

.blue-button span { 
    display: inline-block; 
    vertical-align: top; 
    border: solid 1px #6d8794; 
    position: relative; 
    border: solid 1px #a6bcc8; 
    background: #85a3b3 url("../images/blue-button-stripes.gif") repeat-x left top; 
    color: #fff; 
    line-height: 26px; 
    -moz-border-radius: 3px; 
    -webkit-border-radius: 3px; 
    border-radius: 3px; 
    behavior: url(css/PIE.php); 
} 

.blue-button a, .blue-button input { 
    border: 0px; 
    padding: 0px 15px; 
    height: 26px; 
    color: #fff; 
    font-weight: bold; 
    font-size: 13px; 
    font-family: Helvetica; 
    text-shadow: 0px 1px #687b85; 
    text-transform: uppercase; 
    text-decoration: none; 
    cursor: pointer; 
    background: none; 
} 

.blue-button:hover a, .blue-button:hover input { 
    text-decoration: underline; 
} 

PHP

public function ShowLoginPanel() 
{  

$this->LoginContent= 
' <div class="column-1-3"> 
     <div class="white-box"> 

      <div class="box-content fixed-height"> 
       <form action="" method="post" class="contact-form"> 
        <div> 
          <span class="blue-button"><span><input type="submit" value="SEND &raquo;" /></span></span> 
         </div> 
         <input type="hidden" name="val" value="checkin"> 
        </div> 
       </form> 
      </div> 
     </div> 
    </div><!--/end .column-1-3 --> ';  

} 

当我点击该按钮时,$ _ POST [ “VAL”]设置,但是当我使用相同的代码在另一个单元(例如为registration.php)

 <div class="icon"><img src="images/register.png" alt="" /></div> 
    <input type="hidden" name="val" value="registration">';  

$ _POST [“val”]未设置,它什么也不做。

你可以从这里http://tinyurl.com/pkw5wly访问我页面为了做一个总结,我的问题是,为什么在洛的div按钮的作品,但在注册DIV它不工作

+1

这不会是一个CSS问题。您的'

'在发布的代码中没有'action'。 “行动”集在哪里? – ken

+0

您可以访问该页面。 – user558126

+1

@LoganMurphy'post'将是方法。 “行动”将成为您希望表单击中的页面。 –

回答

0

您不能访问$ _ POST [“VAL”除非你是提交表单具有post

<form method="post" action="handler.php"> 
    <input name="val"/> 
    <input type="submit"/> 
</form> 

一个method然后你可以否则访问$ _ POST变量

echo $_POST["val"]; 

可以设置为method="get"(或者未指定非常有可能的方法)并使用$ _GET变量

echo $_GET["val"]; 
+0

谢谢,这是解决方案! – user558126

1

注册按钮不可在任何form,所以点击它什么都不做。

解决方案:在登记输入周围放置一个form

+0

非常感谢,这是解决方案! – user558126