通过 CURL 发布带有文本区域和 onClick=Java... 的 (ASP) 表单
我正在尝试将一些信息传递到 ASP 网页。 页面上的表单如下所示:
<form name=onlineform method=post onSubmit="javascript:return false;">
<input type=hidden name="form" value="">
<textarea name=item rows=5 cols=33 onBlur="this.value=removeSpaces(this.value);" tabindex="1"></textarea>
<input type="text" name="Email" size="26" tabindex="2">
<input type="image" src="resetButton.gif" width="60" height="30" border="0" onClick="javascript:onlineform.reset();" align="bottom" tabindex="3">
<input type="image"src="SubmitButton.gif" name="Submit" width="60" height="30" border="0" onClick=javascript:check_input() align="bottom" tabindex="4">
</form>
电子邮件部分是可选的,因此我只想填写文本区域并提交表单,捕获稍后显示的退货。
我的问题1是文本区域,问题2是提交(onClick=javascript:.....)。
有人可以帮忙吗?
谢谢 !!!
I'm trying to pass some info to an ASP webpage.
The form on the page looks as following:
<form name=onlineform method=post onSubmit="javascript:return false;">
<input type=hidden name="form" value="">
<textarea name=item rows=5 cols=33 onBlur="this.value=removeSpaces(this.value);" tabindex="1"></textarea>
<input type="text" name="Email" size="26" tabindex="2">
<input type="image" src="resetButton.gif" width="60" height="30" border="0" onClick="javascript:onlineform.reset();" align="bottom" tabindex="3">
<input type="image"src="SubmitButton.gif" name="Submit" width="60" height="30" border="0" onClick=javascript:check_input() align="bottom" tabindex="4">
</form>
The email section is optional so I would only like to fill the text area and submit the form, capturing the return to be displayed later.
Problem 1 I have is the text area, problem 2 is the submit (onClick=javascript:.....).
Can anyone help?
Thanks !!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
onsubmit="return false;"
的作用是防止表单在未经过验证的情况下提交(函数check_input()
,附加到onclick
处理程序)。一旦失去焦点,文本区域只需对其内容执行函数removeSpaces()
(无论它做什么)。所以实际上,如果您在 PHP 上创建输入,您只需确保您的输入通过验证 (
check_input()
),并且您的文本区域输入已“应用”removeSpaces() 函数(您可能需要用 PHP 重写它)。
然后您可以发布到 ASP 脚本,它将无法判断表单是否已通过表单实际提交。
另外,如果您遇到任何困难,请首先尝试发布与浏览器完全相同的内容。要了解/查看这一点,您可以使用 LiveHTTPHeaders 之类的内容,并使 cURL 发布与浏览器。然后根据您的需要进行调整。
What that
onsubmit="return false;"
does is prevent the form from submitting without going through validation (the functioncheck_input()
, which is attached to theonclick
handler). The textarea just has to execute the functionremoveSpaces()
to its contents (whatever that does) once it loses focus.So really, if you are creating the input on PHP you just have to make sure your input passes validation (
check_input()
) and your textarea input has "applied" theremoveSpaces()
function (you might have to rewrite that in PHP).Then you can post to the ASP script and it won't be able to tell if the form has been actually submitted via the form or not`.
Also, if you are having any difficulties, first try to post exactly the same thing as the browser would. To know/see that, you can use something like LiveHTTPHeaders and make cURL post the same fields and values as the browser. Then tweak it to your needs.