我在卓越网上down下一个页面(是订单确认的那个页面),发现这个表单很奇怪
其中表单头是这样子的(这个form是用来提交订单确认的,点击订单确认按钮后就自动跳到了一个付款页面)
<FORM id=form3 name=form3 action="" method=post>
如果action是空,那会提交到哪里去啊它的订单确认按钮是这样的
<INPUT onclick="return checkinvoice()" type=image height=37 alt=订单确认 
  width=116 src="comfirm.files/az-s-place-order_01.gif" border=0> onclick上对应的函数是这样的
function checkinvoice()
{
var checkdate;
checkdate = checkshipdate();
if (checkdate==true){
if (document.getElementById("needinvoice").checked==true){
if (document.getElementById("invoicetitle").value.Trim()=="" || document.getElementById("invoicecontent").value.Trim()=="^^" || document.getElementById("invoicetitle").value.Trim().length>21){
showpop();
return false;
}
} var is_use_card=document.getElementById("isUseGC").value;
// alert(is_use_card);
if(is_use_card!=0){
 showGiftCardPop();
 return false;
     } if (document.getElementById("hiddendup").value=="1"){
showduppop();
return false;
}
}else{
return false;
}

}
从头到位,我连一个链接都没看到,那么他是怎么选择提交页面的呢
还有,这个函数checkinvoice()全部都是return false,那什么时候会return 一个true啊,
这个问题我确实想不明白,高手帮忙,嘻嘻,菜鸟有你们才能飞翔

解决方案 »

  1.   

    action 可以为空,为空时就是提交给它本身默认返回true
      

  2.   

    <INPUT onclick="return checkinvoice()"
    关键在此。你在那个checkinvoice函数里也看到那些判断了,一旦符合判断条件,就return flase//强制返回flase  (就是返回0)
    当没有匹配那些判断条件时,checkinvoice函数应该是非0值的,返回非0即返回了TRUE.呵呵
      

  3.   

    嘻嘻,谢谢大家,问题解决了一半还有一个问题
    为什么我按下这个 订单提交按钮会触发form表单提交呢它的订单确认按钮是这样的 
    <INPUT onclick="return checkinvoice()" type=image height=37 alt=订单确认 
      width=116 src="comfirm.files/az-s-place-order_01.gif" border=0> form提交不是要用<input type="submit" >这种东西吗
    个人觉得这个订单提交的按钮只能触发checkinvoice()这个函数,并不能使表单提交,
    但事实确是相反,为什么啊
      

  4.   

    image 和submit默认都会递交表单