2012-07-22 50 views
0

我有一个包含以下HTML元素的PHP页面。HTML页面在表单提交后保持重复

<div id="templatemo_banner" onClick="parent.location='../index.php'"> 
    <div id="logo"></div> 
</div> 

<div id="templatemo_menu_search"> 
    <div id="templatemo_menu"> 
     <?php include("../template/menu.php"); ?>  
    </div> <!-- end of menu --> 

    <div id="search_section"> 
     <form action="#" method="get"> 
      <input type="text" value="Enter keyword here..." name="q" size="10" id="searchfield" title="searchfield" onfocus="clearText(this)" onblur="clearText(this)" /> 
      <input type="submit" name="Search" value="Search" alt="Search" id="searchbutton" title="Search" /> 
     </form> 
    </div> 

    <div class="cleaner"></div> 
</div> 

在各自的CSS文件:

#templatemo_banner { 
width: 960px; 
height: 288px; 
margin: 0 auto; 
    background: url(images/templatemo_banner_bg.jpg) no-repeat; 
border-bottom: 5px solid #cfd389; 
} 

#templatemo_banner #logo { 
float: left; 
margin: 100px 0 0 80px; 
width: 673px; 
height: 128px; 
background: url(images/templatemo_logo.jpg) no-repeat; 
} 

#templatemo_menu_search { 
clear: both; 
width: 960px; 
height: 50px; 
background: url(images/templatemo_menu_bg.jpg) no-repeat; 
} 

#templatemo_menu { 
float: left; 
width: 650px; 
height: 50px; 
} 

#templatemo_menu ul { 
margin: 0px; 
padding: 0px; 
list-style: none; 
} 

#templatemo_menu ul li { 
display: inline; 
} 

#templatemo_menu ul li a { 
float: left; 
display: block; 
padding: 0 30px; 
height: 35px; 
padding-top: 18px; 
text-align: center; 
font-size: 12px; 
text-align: center; 
text-decoration: none; 
color: #333333; 
font-weight: bold; 
outline: none; 
} 

#templatemo_menu li a:hover, #templatemo_menu li .current { 
color: #ffffff; 
background: url(images/templatemo_menu_hover.jpg) no-repeat;  
} 

我面对这个问题,在上述html元素重演一次之后,我执行表单提交。您可以将它描绘为好像在我拥有我的横幅和菜单后,原始设置下方会有一个额外的横幅和菜单。无论如何,额外的元素在我刷新页面后消失。

我会很感激任何意见。我使用Google Chrome作为浏览器在XAMPP 1.7.7中运行此代码。

+0

摆脱形式的行动哈希''#的。把它留空或者把文件名放在那里。 – 2012-07-22 18:00:12

+0

表单动作中没有哈希表:D – rofans91 2012-07-22 18:00:52

+0

确定吗? '

' – 2012-07-22 18:01:42

回答

1

在行动中取出散...

<form action="" method="get"> 
+0

做到了,但不是问题仍然存在。无论如何thx .. – rofans91 2012-07-22 18:07:54

+0

现在有什么问题? – 2012-07-22 18:08:43

+0

我刚才提到的元素仍然在重复着自己.. – rofans91 2012-07-22 18:09:18

相关问题