【发布时间】:2012-12-21 17:38:39
【问题描述】:
我一直在阅读 Django Book,但在理解表单时遇到了麻烦。
参考:http://www.djangobook.com/en/2.0/chapter07.html
以下让我感到困惑:
<html> <head>
<title>Search</title> </head> <body>
<form action="/search/" method="get">
<input type="text" name="q">
<input type="submit" value="Search">
</form> </body> </html>
我知道“action”决定了要转到哪个 URL,“name”决定了如何区分传入的 HTTP 响应,但“value”有什么作用?我什么时候需要访问“价值”或如何访问?
【问题讨论】:
-
这根本不是一个 Django 问题。