HTML表单没有操作 [英] HTML Forms without actions

查看:101
本文介绍了HTML表单没有操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Django / Pinax中,我遇到了以下开始的登录表单:

 < form class = loginmethod =POSTaction => 

它工作得很好。所以我假设有一些java脚本或Django框架中的某些东西将值放入action属性中。所以我的问题



a)Django如何插入动作?



b)为什么这样做? / p>

b)如何查看此表单的操作?



更新:我看到这是不是一个Django的东西,但大多数浏览器都是做的。

解决方案

在大多数浏览器中都有一个空字符串的操作指向表单在浏览器当前已加载的URL上,这是首先提供表单的脚本。


In Django / Pinax, I've come across the login form which starts like this :

<form class="login" method="POST" action="">

It works perfectly well. So I assume that either some java-script or something in the Django framework is putting the value into the action attribute. So my questions ;

a) How does Django insert the action?

b) Why do they do it like this?

b) How can I find out what the action of this form is?

Update : I see this is not a Django thing at all but what most browsers do.

解决方案

Having an action of an empty string in most browsers points the form at the URL the browser currently has loaded, which is the script that served the form in the first place.

这篇关于HTML表单没有操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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