<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "如何在表單上放不同的按鈕然後導到不同的action頁面去？"]]></title>
		<link>https://forum.andowson.com/posts/list/5.page</link>
		<description><![CDATA[Latest messages posted in the topic "如何在表單上放不同的按鈕然後導到不同的action頁面去？"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>如何在表單上放不同的按鈕然後導到不同的action頁面去？</title>
				<description><![CDATA[ 我們可以透過JavaScript動態修改表單的action值來達成 
<br>
[code=html] 
<br>
&lt;SCRIPT language="JavaScript"&gt; 
<br>
function OnSubmitForm() 
<br>
{ 
<br>
 if(document.pressed == 'Insert') 
<br>
 { 
<br>
 document.myform.action ="insert.html"; 
<br>
 } 
<br>
 else 
<br>
 if(document.pressed == 'Update') 
<br>
 { 
<br>
 document.myform.action ="update.html"; 
<br>
 } 
<br>
 return true; 
<br>
} 
<br>
&lt;/SCRIPT&gt; 
<br>
<br>
&lt;FORM name="myform" onSubmit="return OnSubmitForm();"&gt; 
<br>
&lt;INPUT TYPE="SUBMIT" name="Operation" onClick="document.pressed=this.value" VALUE="Insert"&gt; 
<br>
&lt;INPUT TYPE="SUBMIT" name="Operation" onClick="document.pressed=this.value" VALUE="Update"&gt; 
<br>
&lt;/FORM&gt; 
<br>
[/code] 
<br>
<br>
參考資料 
<br>
[url=http://www.javascript-coder.com/html-form/html-form-action.phtml]How to switch the 'action' field in an HTML form dynamically[/url]]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/229/345.page</guid>
				<link>https://forum.andowson.com/posts/preList/229/345.page</link>
				<pubDate><![CDATA[Tue, 1 Apr 2008 20:07:38]]> GMT</pubDate>
				<author><![CDATA[ andowson]]></author>
			</item>
	</channel>
</rss>