通过JavaScript访问已发布的表单对象 [英] Accessing posted form objects via JavaScript

查看:37
本文介绍了通过JavaScript访问已发布的表单对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ASP,您可以访问已发布的表单元素。是否可以通过JavaScript访问它们?

myHTML.htm

< form action = myASP.asp>

< input type = hidden id = f1 value = val1>

< input type = hidden id = f2 value = val2>

< input type =提交值="选择我>

< / form>

myASP.ASP

response.write(请求(f1))

Using ASP you can access posted form elements. Is it possible to
access them from JavaScript?
myHTML.htm
<form action=myASP.asp>
<input type=hidden id=f1 value=val1>
<input type=hidden id=f2 value=val2>
<input type=submit value="Choose Me">
</form>

myASP.ASP
response.write(request("f1"))

推荐答案

注意。我需要使用METHOD =" POST"。我的想法是,我将使用SSL命中

myASP.asp,f1和f2将存储用户ID / pw。如果我使用

METHOD =" GET" userid / pw将附加到URL并通过

明文发送。

Note. I need to use METHOD="POST". The idea is that I''ll hit
myASP.asp using SSL and f1 and f2 will store a userid/pw. If I use
METHOD="GET" the userid/pw will be appended to the URL and sent via
clear text.




观察:如果我在表单中使用id或名称,则会有所不同,例如

< input type =" button"名称= QUOT; F1" />

为了接受btw asp文件和html。


Observation: There is different if I used id or name in form e.g.
<input type="button" name="f1" />
In order to connerct btw asp file and html.


Choxio写道:
Choxio wrote:
注意。我需要使用METHOD =" POST"。我的想法是,我将使用SSL命中 myASP.asp,f1和f2将存储用户ID / pw。如果我使用
METHOD =" GET" userid / pw将被附加到URL并通过
明文发送。
Note. I need to use METHOD="POST". The idea is that I''ll hit
myASP.asp using SSL and f1 and f2 will store a userid/pw. If I use
METHOD="GET" the userid/pw will be appended to the URL and sent via
clear text.




如果您使用帖子,他们仍然通过明文发送,只是没有在URL中。如果你想加密数据,请使用

HTTP和SSL(HTTPS)。


-

David Dorward< http ://blog.dorward.me.uk/> < http://dorward.me.uk/>

首页是〜/ .bashrc的位置



If you use post they are still sent via clear text, just not in the URL. Use
HTTP with SSL (HTTPS) if you want to encrypt the data.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


这篇关于通过JavaScript访问已发布的表单对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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