iframe提交,做頁面無刷新 cao


 <form action='checkok.asp' method=post name=myform   οnsubmit="return autoisempty(this)"  target=_del>

</form>

 <iframe src="" width=0 height=0 name=_del  id=_del></iframe>

-------------

 <script>
 var b1;
function autoisempty(thisfrom)

 
        var l=-1;
        for (var i=0;i<thisfrom.reason.length;i++ )
        {
         if (thisfrom.reason[i].checked)
            l=i;
        }
        
        if (thisfrom.thestatus[0].checked&&  l==-1)
            {
            
             }

if (!thisfrom.thestatus[0].checked  && !thisfrom.thestatus[1].checked   )
{
                    showerror('對不起, 請選擇是否同意!',';');


 
return false;
 
}
 
if (thisfrom.thestatus[1].checked&& !thisfrom.refusereason[0].checked && !thisfrom.refusereason[1].checked  )
{
                    showerror('對不起, 請選擇駁回原因!',';');
    return false;
}
 
}
</script>


/***********************/

getinfo.asp


<!-- #include virtual=/inc/cov.asp-->
<!-- #include virtual=/inc/function.asp-->
<script >
<%  
  idx=cdbl(request("q"))
  sql="p_auto_wf_overtime_show_idx "&idx & ",0" 


   
  set rs=conn.execute(sql)
  if not rs.eof then
     %>
  parent.document.myform.idx.value='<%=idx%>';
   parent.document.forms.myform.thedate.value='<%=rs("thedate")%>';
  parent.document.forms.myform.dayclass.value='<%=rs("dayclass")%>';
  parent.document.forms.myform.b_h.value='<%=rs("b_h")%>';
  parent.document.forms.myform.b_m.value='<%=rs("b_m")%>';
  parent.document.forms.myform.e_h.value='<%=rs("e_h")%>';
  parent.document.forms.myform.e_m.value='<%=rs("e_m")%>';
  parent.document.forms.myform.m1.value='<%=rs("m")/60%>';
  parent.document.forms.myform.c_name.value='<%=rs("c_name")%>';
  parent.document.forms.myform.proj.value='<%=rs("proj")%>';
  parent.document.forms.myform.info.value='<%=rs("info")%>';
  parent.document.forms.myform.manager.value='<%=rs("manager")%>';
 
   
 
  <% 
  sql="select username,name from showone_finance.dbo.members  (nolock) where idx="&rs("memberidx")
  set rs=conn.execute(sql)
  if not rs.eof then%>
   parent.document.forms.myform.name.value='<%=rs("name") %>(<%=rs("username") %>)'
  <%end if 
  end if
 
%>


 </script>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章