通过 CURL 发布带有文本区域和 onClick=Java... 的 (ASP) 表单

发布于 2024-09-18 04:24:32 字数 830 浏览 4 评论 0原文

我正在尝试将一些信息传递到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

决绝 2024-09-25 04:24:32

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 function check_input(), which is attached to the onclick handler). The textarea just has to execute the function removeSpaces() 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" the removeSpaces() 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文