2013-04-05 47 views
0

我有一个非常简单的html页面,其中包含一个窗体和很少的控件。该html页面托管在服务器上。当我在表单中输入一些值时,它不会在表单发布数据中显示输入值。html表单不会在回发中发布输入控制值

不仅具有BTN1 =交其他控件未列出有

下面

reuest体是HTML:

<!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> 
    <title>test</title> 
</head> 
<body>  
    <form id="form4" action="somePage.htm" method="post" > 
    <input type="text" id="textMain1" value="" /> 
    <input type="text" id="textMain2" value=""/> 
    <input type="text" id="textMain3" value=""/> 

    <input type="submit" id="btn1" name="btn1" /> 
    </form> 
</body> 
</html>![enter image description here][2] 

这些事情我已经尝试: -adding姓名和身份证一起属性输入控制 -adding RUNAT =服务器的情况下(html页面被写入VS IDE) -add ENCTYPE = “多部分/格式数据”,以形成 -run它在铬浏览器

回答

0

可能是这个link定义你想要的东西,有用的

$("#form4").submit(function(event) { 

/* stop form from submitting normally */ 
event.preventDefault(); 

/* get some values from elements on the page: */ 
var values = $(this).serialize(); 

/* Send the data using post and put the results in a div */ 
$.ajax({ 
    url: "test.php", 
    type: "post", 
    data: values, 
    success: function(){ 

    }, 

    }); 
}); 
+0

你STANGE但一个简单的IISRESET解决了这个问题。由于客户端浏览器不支持它,因此无法使用Jquery。始终在您打算在发布数据中出现的控件中使用名称属性。 name1:2 name2:5 name3:6 btn1:post – Mani 2013-04-05 06:35:30