免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
在同一form表單中如何提交兩個(gè)不同的action
在同一form表單中如何提交兩個(gè)不同的action

有兩種辦法可以實(shí)現(xiàn):
1.針對(duì)一個(gè)action有多個(gè)提交按鈕,那么在提交后進(jìn)行根據(jù)ID進(jìn)行一下判斷,是哪個(gè)提交的執(zhí)行哪種動(dòng)作,這是可以實(shí)現(xiàn)的。
2.直接做成兩個(gè)form,每個(gè)form里的action不同,都有一個(gè)提交按鈕,從客戶看來(lái)是沒(méi)有區(qū)別的,但是提交的時(shí)候,會(huì)提交到不到的action里去.

第一種的實(shí)現(xiàn):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
<title>Java Applet......</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="pragma" content="no-cache">
<meta name="Author" content="YuLimin,俞黎敏,DayBreak,Beyond DayBreak Office Master">
</head>

<body bgcolor="#FFFFFF">
<center>
<form action="" name="form1">
    <input type="button" value="查詢1" type="submit" onclick="form1.action='action_1';form1.submit();"/>
    <input type="button" value="查詢2" type="submit" onclick="form1.action='action_2';form1.submit();" />
</form>

</center>
</body>
</html>

例子:這樣也許更清晰:

<Script Language="JavaScript">
    function modify()
    {
    document.form1.action="modify.jsp";
    document.form1.submit();
    }
    
    function delete()
    {
    document.form1.action="delete.jsp";
    document.form1.submit();
    }
    </Script>
    
    <form name="form1" action="">
    <INPUT Type="Button" Name="Modify" Value="修 改 " onClick="modify()">
     <INPUT Type="Button" Name="Delete" Value="刪 除 " onClick="delete()">
    </form>
    這樣可以實(shí)現(xiàn)將多個(gè)按鈕發(fā)送到不同網(wǎng)頁(yè)中。

第二種實(shí)現(xiàn):

提交form的時(shí)候,里面的action不能帶參數(shù)。

如:

<form action="test.do?args=888">

<input type="button" value="submit">

</form>

通過(guò)這個(gè)方法,test.do無(wú)法讀取args,必須換成一下寫法

<form action="test.do">

<input type="hidden" name="args" value="888">

<input type="button" value="submit">

</form>
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
一個(gè)表單form、submit提交到多個(gè)不同頁(yè)面
FORM中使用onSubmit="return false"防止表單自動(dòng)提交,以及subm...
【轉(zhuǎn)載】php和JS實(shí)現(xiàn)表單多按鈕提交action的方法
回車鍵敲在文本框里來(lái)提交表單的實(shí)現(xiàn)
實(shí)現(xiàn)多個(gè)submit提交按鈕提交同一個(gè)表單。
Html form <input>表單標(biāo)簽type(text submit checkbox radio)控件元素
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服