后jquery post我不能读取形式值与冷灌 [英] After jquery post I can't read form values with coldfusion
本文介绍了后jquery post我不能读取形式值与冷灌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个jquery帖子:
<!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
< html xmlns =http://www.w3.org/1999/xhtml>
< head>
< script type =text / javascriptsrc =./ js / jquery-1.4.3.min.js>< / script>
< script type =text / javascript>
$(document).ready(function(){
$(#JqPostForm)。submit(function(){
$ .post(messages.cfm,$( #JqPostForm)。serialize());
return false;
});
});
< / script>
< / head>
< body>
< form id =JqPostForm>
< p>< label for =name_post>名称:< / label>< br /
< input id =name_posttype =textname =name_post/>< / p>
< p>< input type =submitvalue =Submit/>< / p>
< / form>
< / body>
< / html>
我在messages.cfm中的代码
< cfoutput> #form.name_post#< / cfoutput>
我有500个内部伺服器错误...
元素NAME_POST在FORM中未定义。
但如果我去cfdebug部分
表单栏位:
FIELDNAMES = NAME_POST
NAME_POST = John doe
firebug:
参数应用程序/ x-www-form-urlencoded
name_post john doe
源
name_post = john + doe
im使用jquery 1.4.3和coldfusion 7
感谢
Plutarco
解决方案
我在application.cfc中删除这一行
< CFSET SetEncoding(FORM,iso-8859-1)/
它工作正常!
/ p>
I have a jquery post:
<!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>
<script type="text/javascript" src="./js/jquery-1.4.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#JqPostForm").submit(function(){
$.post("messages.cfm", $("#JqPostForm").serialize());
return false;
});
});
</script>
</head>
<body>
<form id="JqPostForm">
<p><label for="name_post">Name:</label><br />
<input id="name_post" type="text" name="name_post" /></p>
<p><input type="submit" value="Submit" /></p>
</form>
</body>
</html>
my code in messages.cfm
<cfoutput> #form.name_post#</cfoutput>
i got 500 Internal Server Error...
Element NAME_POST is undefined in FORM.
but, if I go cfdebug section
Form Fields:
FIELDNAMES=NAME_POST
NAME_POST=John doe
firebug:
Parameters application/x-www-form-urlencoded
name_post john doe
Source
name_post=john+doe
im using jquery 1.4.3 and coldfusion 7
Thanks
Plutarco
解决方案
I delete this line in my application.cfc
<CFSET SetEncoding("FORM", "iso-8859-1") />
it works fine!
thanks
这篇关于后jquery post我不能读取形式值与冷灌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文