HTML表单不会提交

时间:2012-02-07 17:03:14

标签: jquery html

我有一个需要将表单数据提交到另一个asp页面的asp页面。我一直在寻找它,无法找到它为什么不提交。这似乎是一个非常基本的页面。

按下提交按钮时没有任何反应。

<form action="buildExcel.asp" method="post">
<div class="center">
<div class="badges">
<div id='TextBoxesGroup'>
  <div id="TextBoxDiv1">
    <label>Badge #1 : </label>
    <input type='text' id='firstName1' name="firstName1" />
    <input type='text' id='lastName1' name="lastName1" />
    <input type='text' id='city1' name="city1" />
    <input type="text" id='state1' name="state1" />
  </div>
</div>
<input type='button' value='New Line' id='addButton' name="addButton"/>
<input type='button' value='Remove Line' id='removeButton' name="removeButton"/>
<input type='button' value='Get TextBox Value' id='getButtonValue' name="getButtonValue"/>
</div>
</div>
<input type="submit" name="Submit" id="Submit" value="Send to Excel" />
</form>

我将添加页面的其余部分,希望在那里的某个地方出现问题:

这高于上面的代码:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.plugins.js"></script>
<script type="text/javascript">

$(document).ready(function(){

var counter = 2;

$("#addButton").click(function () {

if(counter>10){
        alert("Only 10 textboxes allow");
        return false;
}   

var newTextBoxDiv = $(document.createElement('div'))
     .attr("id", 'TextBoxDiv' + counter);

newTextBoxDiv.after().html('<label>Badge #'+ counter + ' : </label>' +
      '<input type="text" name="firstName' + counter + 
      '" id="firstName' + counter + '" value="" />' +
      '<input type="text" name="lastName' + counter + 
      '" id="lastName' + counter + '" value="" />' +
      '<input type="text" name="city' + counter + 
      '" id="city' + counter + '" value="" />' +
      '<input type="text" name="state' + counter + 
      '" id="state' + counter + '" value="" />');

newTextBoxDiv.appendTo("#TextBoxesGroup");


counter++;
 });

 $("#removeButton").click(function () {
if(counter==1){
      alert("No more textbox to remove");
      return false;
   }   

counter--;

    $("#TextBoxDiv" + counter).remove();

 });

 $("#getButtonValue").click(function () {

var msg = '';
for(i=1; i<counter; i++){
  msg += "\n Textbox #" + i + " : " + $('#textbox' + i).val();
}
      alert(msg);
 });
});
</script>
<link rel="stylesheet" type="text/css" href="css/css.css" />
<!--[if lt IE 8]>
<link href="css/ie.css" rel="stylesheet" type="text/css" />  
<![endif]-->
</head>

1 个答案:

答案 0 :(得分:0)

我认为,您应该在页面顶部指定如下: -

<%@CODEPAGE="1252"%>

OR

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>