表单提交后HTML页面保持重复

时间:2012-07-22 17:57:15

标签: php html css

我有一个包含以下HTML元素的PHP页面。

<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元素在我执行表单提交后重复了一次。你可以想象它,就像我有我的横幅和菜单后,在原始集下面有一个额外的横幅和菜单。无论如何,刷新页面后额外的元素都会消失。

我将不胜感激任何建议。我使用谷歌浏览器作为我的浏览器在XAMPP 1.7.7中运行此代码。

1 个答案:

答案 0 :(得分:1)

删除操作中的哈希...

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