什么是< form action ="#">和< form method =" post"行动= QUOT;#>做? [英] what do <form action="#"> and <form method="post" action="#> do?

查看:137
本文介绍了什么是< form action ="#">和< form method =" post"行动= QUOT;#>做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读一本关于html开发的书(我相当熟悉),尽管这本书刚刚在一个月前(2011年11月)第一次发布,但作者是一位经验丰富的编码人员,或许使用表单中的动作是老派?

因为我试图获得示例代码的要点,并且找不到 form action =#的解释尽管搜寻

 < form action =#> 

在谷歌,在SO和www.w3schools.com上。

任何人都知道动作对于表单的含义是什么?

解决方案动作通常指定表单提交到的文件/页面(使用方法参数(post,get等)中描述的方法)

的动作表明表单停留在同一页面上,只需在后面加上后缀即可。类似的用法发生在锚点中。例如,< a href =#> Link< / a> 将保持在同一页面上。

因此,表单被提交到相同的页面,然后处理数据等。


I'm reading a book on html development (which I'm fairly new at) and despite the fact that the book just had its 1st publishing one month ago (Nov. 2011), the author is an experienced coder and maybe using # for the action in a form is old school?

Because I'm trying to get the gist of the sample code and I cannot find an explanation of form action="#" despite searching for

<form action="#">   

on google, on SO, and in www.w3schools.com.

Anyone know what the # action means for forms?

解决方案

Action normally specifies the file/page that the form is submitted to (using the method described in the method paramater (post, get etc.))

An action of # indicates that the form stays on the same page, simply suffixing the url with a #. Similar use occurs in anchors. <a href=#">Link</a> for example, will stay on the same page.

Thus, the form is submitted to the same page, which then processes the data etc.

这篇关于什么是&lt; form action =&quot;#&quot;&gt;和&lt; form method =&quot; post&quot;行动= QUOT;#&GT;做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆