首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

按照the Django book上面的例子写了一个表单处理程序, 有点有关问题,帮忙给看看

2013-09-13 
按照the Django book上面的例子写了一个表单处理程序, 有点问题,帮忙给看看!!DOeCTYPE HTML PUBLIC -//W

按照the Django book上面的例子写了一个表单处理程序, 有点问题,帮忙给看看!


<!DOeCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<title>Html Test</title>
<html>
<body>
<br>
<label>phone num</label>
<input type="text" id="phoneNum" name="phoneNum" value="" style="width: 100px"/>
<br>
<form action="." method="Get">
<label for="m">msg</label>
<input type="text" mame="m" value="{{msg|escape}}" style="width: 500">
<input type="submit" name = "send" value="send"class="button" >
</form>
{% if msg %}
<p>{{ msg|escape}</p>
{% else %}
<p>no msg</p>
{% endif %}
</body>
</html>


def hello(request):
    msg = request.GET.get("m", "")
    return render_to_response("test.html", {"msg", msg})


我想要的执行效果是,我点击send按钮,如果msg框里面有内容, 下面就会显示msg框里面的内容.不然就显示no msg!
但是执行的时候一直都是显示no msg! 而且浏览器地址栏里面也是"http://127.0.0.1:8000/?send=send",而不是http://127.0.0.1:8000/?m=XXX! django 表单
[解决办法]
mame 6characters

热点排行