2012-02-07 143 views
0

我有一個asp頁面需要提交表單數據到另一個asp頁面。我一直在查看它,並找不到爲什麼它不會提交。這似乎是一個非常基本的頁面。html表格不會提交

按下提交按鈕時沒有任何反應。

<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> 
+0

我沒有看到任何錯誤,它可能是一些你正在運行的JavaScript,它阻止它發送。 – Alex 2012-02-07 17:05:48

+0

也許有一些JS取消了表單提交。你有沒有在你的網頁上的任何JavaScript? – antyrat 2012-02-07 17:06:26

+0

看起來很好......你的DTD XHTML是? – Nabab 2012-02-07 17:20:18

回答

0

我想,你應該指定頂部頁面如下: -

<%@CODEPAGE="1252"%> 

OR

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

爲什麼,什麼是錯誤的Unicode? – 2012-02-07 17:47:57