由买买提看人间百态

topics

全部话题 - 话题: checkform
(共0页)
s*****p
发帖数: 5342
1
来自主题: Java版 - so weird
I have javascript like:
function checkForm(form, url) {
...
if ( valid == 1 ) {
form.action = url;
form.submit();
}else {
alert( 'error message' );
return;
}
}
In my jsp:
onclick="checkForm(this.
form, '/registry.do?method=create');" />
However, even when valid = 0, the form still gets sent after getting 'error
message'. How can I stop it send
s*****p
发帖数: 5342
2
来自主题: Programming版 - so weird (转载)
【 以下文字转载自 Java 讨论区 】
发信人: startup (follow without thinking), 信区: Java
标 题: so weird
发信站: BBS 未名空间站 (Fri Aug 15 15:13:15 2008)
I have javascript like:
function checkForm(form, url) {
...
if ( valid == 1 ) {
form.action = url;
form.submit();
}else {
alert( 'error message' );
return;
}
}
In my jsp:
onclick="checkForm(this.
form, '/registry.do?me
t******g
发帖数: 10390
3
有些不合法,小心.

http://www.weather.com/search/search" METHOD="get" NAME="whatwhere" onSubmit="return checkForm();">



p****t
发帖数: 1
4
通过新浪的短消息页面http://sms.sina.com.cn/docs/send.html发送短消息,
填好信息后按发送键,服务器调用http://sms.sina.com.cn/cgi-bin/sms/send.cgi完成
向手机发送短消息功能。
请问我如何向http://sms.sina.com.cn/cgi-bin/sms/send.cgi这个页面发送一条POST请
求完成同样的提交,如何向send.cgi传递参数呢?或者有别的更好的方法。
察看了一下http://sms.sina.com.cn/docs/send.html这个页面的源代码,有这么一段:
http://sms.sina.com.cn/cgi-bin/sms/send.
cgi" onsubmit="return checkform()">
不知道有没有这样的检测工具,可以在我操作提交的时候看到POST的内容?
m******t
发帖数: 2416
5
来自主题: Java版 - so weird
An image button always submits the form like a submit button does.
So:
1. You don't need the onclick. Instead move checkForm() to
the form's onsubmit.
2. You don't need to call form.submit(). Instead either return
true or false depending on whether the input is valid.
Oh, and none of this stuff has anything to do with java, by
the way. 8-)
f*****Q
发帖数: 1912
6
来自主题: Programming版 - so weird (转载)
try
onclick="checkForm(this.
form, '/registry.do?method=create'), return false;" />
maybe work maybe not. I haven't done this for a long time.
(共0页)