After jquery post I can't read form values with coldfusion

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 07:49:05

问题


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


回答1:


I delete this line in my application.cfc

<CFSET SetEncoding("FORM", "iso-8859-1") />

it works fine!

thanks



来源:https://stackoverflow.com/questions/4025492/after-jquery-post-i-cant-read-form-values-with-coldfusion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!