1

我有一个简单的一页表格,我已经写了几十次了,但这种行为对我来说是全新的。起初,它是在页面加载时提交的,因此会自动重定向到该系列的下一页。我仍然不确定我是如何让它停止的,但是现在当你点击“提交”时它根本没有做任何事情。该页面只是坐在那里。

我尝试删除错误检查脚本、显示/隐藏脚本,甚至 jquery 本身,然后将表单简化为一个输入。我尝试摆脱重定向并让它输出一个简单的行,然后是 vardump,但仍然没有。我点击提交,无论我做什么,页面都在那里。我以前从未遇到过这样的行为,firebug 等人没有给我任何错误或线索。

如果有人有任何想法,无论多么疯狂,我都愿意尝试。我不知所措。提前致谢!

<?php
session_start();
include('functions.php');

if ($_POST['submit']) {
    $company = $_POST['company'];
   $taxid = $_POST['taxid'];
   header("location:step2.php");
}
include('head.php'); ?>

<form method="post" name="basic" action="step1.php">

<div class="col70">
   <label for="company">Organization/Business name <img src="img/req.jpg" alt="required"></label>
   <input type="text" name="company" id="company" value="" />
</div>

<div class="col30">
   <label for="taxid">Taxpayer ID# (IEN or SS#) <img src="img/req.jpg" alt="required"></label>
   <input type="text" name="taxid" id="taxid" value="" />
</div>

<div class="newcol">
   <label for="address">Mailing Address <img src="img/req.jpg" alt="required"></label>
   <input type="text" name="address" id="address" value="" />
</div>

<div class="col30 newcol">
   <label for="city">City <img src="img/req.jpg" alt="required"></label>
   <input type="text" name="city" id="city" value="" />
</div>

<div class="col30">
   <label for="state">State <img src="img/req.jpg" alt="required"></label>
   <select name="state" id="state" tabindex="<?php echo $tabin; $tabin++; ?>">
       <option value="0"></option>
       <option value="1">Alabama</option>
   </select>
</div>

<div class="col25">
   <label for="zipcode">Zip Code <img src="img/req.jpg" alt="required"></label>
   <input type="text" name="zipcode" id="zipcode" value="" />
</div>

<fieldset><legend>1. What kind of group/company do you have? <img src="img/req.jpg" alt="required"></legend>
   <span id="nfpfp" class="InputGroup">
       <label><input name="nfpfp" id="nfpfp_1" type="radio" value="1" />For-profit business.</label>
       <label><input name="nfpfp" id="nfpfp_2" type="radio" value="2" />Non-profit 501(c)3 organization.</label>
   </span>    
</fieldset>

<fieldset><legend>2. How will you use the booth space? Select all that apply. <img src="img/req.jpg" alt="required"></legend>
   <span id="type" class="InputGroup">
       <label><input name="food" id="type_1" type="checkbox" value="1" />Food sales</label>
       <label><input name="retail" id="type_2" type="checkbox" value="2" />Retail sales</label>
       <label><input name="activity" id="type_3" type="checkbox" value="3" />Activity</label>
       <label><input name="display" id="type_4" type="checkbox" value="4" />Display</label>
       <label><input name="other" id="type_5" type="checkbox" value="5" />Other</label>
   </span>    
</fieldset>

<label for="otherdetails" class="newcol offsides">Enter a short description of your use. (Ex: "BBQ sandwiches", "kite kits", "face painting".) <img src="img/req.jpg" alt="required"></label> 
   <input type="text" name="otherdetails" id="otherdetails" value="" />



<fieldset><legend>3. Select any/all that apply. Additional questions may appear, if further information is required.</legend>
   <span id="additional" class="InputGroup">
       <label><input name="raffle" id="raffle_1" type="checkbox" class="switchcheck1" value="1" />I'll be selling raffle tickets and/or holding a raffle at the festival.</label>
           <div class="newcol offstate1">
           <label for="raffledetails">You'll need written permission from the Exchange Club. Please enter details about the raffle. <img src="img/req.jpg" alt="required"></label>
               <textarea name="raffledetails" id="raffledetails" tabindex="<?php echo $tabin; $tabin++; ?>"></textarea>
           </div>

       <label><input name="trailer" type="checkbox" id="trailer_1" value="1">I'll be bringing a trailer.</label>
       <label><input name="outlets" type="checkbox" id="outlets_1" class="switchcheck2" value="1" />I'll require electrical outlets.</label>
           <div class="newcol offstate2">
           <label for="outletsdetails">How many outlets will you require? <img src="img/req.jpg" alt="required"></label>
               <input type="text" name="outletsdetails" id="outletsdetails" />
           </div>
       </span>    
</fieldset>



<input type="button" name="submit" class="a_button" value="submit" />

</form>
4

2 回答 2

3

name="submit"带有is 类型button和 not的元素submit,因此它呈现一个什么都不做的普通按钮(目的是您将一些 JavaScript 绑定到它)。

改为使用type="submit"

于 2012-08-12T19:21:48.107 回答
0

尝试

<input type="submit" name="submit" class="a_button" value="submit" />

为您的提交按钮。

于 2012-08-12T19:22:34.923 回答