怎样在Webbrowser中修改Form表单并提交?
<form name="form1" method=post onSubmit="return form1Submit()">
为了避免函数里的window.confirm 想直接修改FORM的onSubmit,不知道该怎么写这个语句?
function form1Submit()
{
var nowDepotSize = 1;
var chargeType = "2";
var ringDepotSize = 10;
var inDepot = "1";
var complete = true;
with(document.form1)
{
if( type.value == "0" )
{
if( nowDepotSize >= ringDepotSize )
{
alert( "!" );
complete = false;
}
else
{
complete = window.confirm( "确定 ? " );
action = "1";
}
}
if (type.value=="1")
{
if( chargeType=="1" && trim(authenCode.value)=="" )
{
alert( "!");
complete = false;
}
else
{
complete = window.confirm("?");
if( chargeType=="2" && nowDepotSize >= ringDepotSize && inDepot=="0")
{
complete = window.confirm("?" );
}
action="1";
}
}
if (type.value=="2")
{
action="2";
}
if (type.value=="3")
{
action="2";
}
}
return complete;
}
问题点数:40、回复次数:4Top
1 楼sunnywq2004(fiona)回复于 2005-06-14 11:56:43 得分 0
!!!!Top
2 楼jiangsheng(蒋晟.Net[MVP])回复于 2005-06-14 15:19:23 得分 40
把FORM的onSubmit事件属性设置成你自己的事件处理函数Top
3 楼sunnywq2004(fiona)回复于 2005-06-15 08:59:27 得分 0
怎么设置??Top
4 楼jiangsheng(蒋晟.Net[MVP])回复于 2005-06-15 12:12:32 得分 0
http://msdn.microsoft.com/workshop/browser/mshtml/tutorials/sink.aspTop




