<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Javascript - two submit buttons - two seperate purposes</title>
	<atom:link href="http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/</link>
	<description></description>
	<pubDate>Fri, 05 Dec 2008 03:32:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Levent Demir</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9949</link>
		<dc:creator>Levent Demir</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9949</guid>
		<description>that is what i want
</description>
		<content:encoded><![CDATA[<p>that is what i want</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jennifer</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9948</link>
		<dc:creator>Jennifer</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9948</guid>
		<description>That is a script completely unrelated to this post that tries to help people coming from Google by searching the rest of the site for similar keywords. Your keyword was "Seperate" - seperate is in the title of this post - as it is probably also in those other posts. It's more for when people are searching for specfic scripts, and they happen to come to a page that may not be the best fit.</description>
		<content:encoded><![CDATA[<p>That is a script completely unrelated to this post that tries to help people coming from Google by searching the rest of the site for similar keywords. Your keyword was &#034;Seperate&#034; - seperate is in the title of this post - as it is probably also in those other posts. It&#039;s more for when people are searching for specfic scripts, and they happen to come to a page that may not be the best fit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9947</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9947</guid>
		<description>Huh, I don't see the correlation?

Re: 

"Google Reference


I noticed you arrived here via Google looking for seperate.
To aid you on your search, here are the top results for your keywords:

August 12, 2003 - "Hi" Script 
June 26, 2003 - Javascript: Exploding a string into an array 
June 20, 2003 - Comment Queue Script/MT hack UPDATED 
June 10, 2003 - Coment Queue Script/MT Hack "</description>
		<content:encoded><![CDATA[<p>Huh, I don&#039;t see the correlation?</p>
<p>Re: </p>
<p>&#034;Google Reference</p>
<p>I noticed you arrived here via Google looking for seperate.<br />
To aid you on your search, here are the top results for your keywords:</p>
<p>August 12, 2003 - &#034;Hi&#034; Script<br />
June 26, 2003 - Javascript: Exploding a string into an array<br />
June 20, 2003 - Comment Queue Script/MT hack UPDATED<br />
June 10, 2003 - Coment Queue Script/MT Hack &#034;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JUan</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9945</link>
		<dc:creator>JUan</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9945</guid>
		<description>Your tutorial are good, easy to understand!
Thank You, very much.</description>
		<content:encoded><![CDATA[<p>Your tutorial are good, easy to understand!<br />
Thank You, very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: insin</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9944</link>
		<dc:creator>insin</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9944</guid>
		<description>Another way to have more than one submit button - use a button's onclick to call a JavaScript function to change the form's action then submit it.

eg. I have a form which can be used to update or delete an item. The hard-coded form action will update the item when you click on the submit button (labeled "Update"), while I have the "Delete" button call this function:

function doDelete()
{
	if(confirm("Do you want to delete this Pre-Requisite Software Item?"))
	{
  document.preReqForm.action = "DeletePreReqItem.do?section=PreReqSoft&#038;tab=tab3";
  document.preReqForm.submit();
	}
}</description>
		<content:encoded><![CDATA[<p>Another way to have more than one submit button - use a button&#039;s onclick to call a JavaScript function to change the form&#039;s action then submit it.</p>
<p>eg. I have a form which can be used to update or delete an item. The hard-coded form action will update the item when you click on the submit button (labeled &#034;Update&#034;), while I have the &#034;Delete&#034; button call this function:</p>
<p>function doDelete()<br />
{<br />
	if(confirm(&#034;Do you want to delete this Pre-Requisite Software Item?&#034;))<br />
	{<br />
  document.preReqForm.action = &#034;DeletePreReqItem.do?section=PreReqSoft&#038;tab=tab3&#034;;<br />
  document.preReqForm.submit();<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jennifer</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9943</link>
		<dc:creator>Jennifer</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9943</guid>
		<description>I guess the only benefit to it being OUTSIDE of the tag itself, is in the case you have a really long confirm message. "You are about to destroy your entire blog. There is no turning back. Are you really absolutely positvely sure you want to delete your entire blog, all your hard work over so many years?" ;-)

Or maybe if there's more than one form that has the same confirm message? or if you want to include other validation stuff...?

There's probably other scenarios I can think of where this would be usefull... but it's good to know if it only needs a simple solution - one is available. :)</description>
		<content:encoded><![CDATA[<p>I guess the only benefit to it being OUTSIDE of the tag itself, is in the case you have a really long confirm message. &#034;You are about to destroy your entire blog. There is no turning back. Are you really absolutely positvely sure you want to delete your entire blog, all your hard work over so many years?&#034; <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
Or maybe if there&#039;s more than one form that has the same confirm message? or if you want to include other validation stuff&#8230;?</p>
<p>There&#039;s probably other scenarios I can think of where this would be usefull&#8230; but it&#039;s good to know if it only needs a simple solution - one is available. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Happy</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9942</link>
		<dc:creator>Happy</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/05/javascript-two-submit-buttons-two-seperate-purposes/#comment-9942</guid>
		<description>It probably would've been cleaner to just put the confirm() function in the onClick attribute instead of calling a user-defined function, saving the response to a variable, testing the variable, and then returning true or false.

confirm() returns a true or false anyway, so the whole thing could be reduced to:

&#60;input type="submit" value="Delete"  onClick="return confirm('Are you sure?')" &#62;</description>
		<content:encoded><![CDATA[<p>It probably would&#039;ve been cleaner to just put the confirm() function in the onClick attribute instead of calling a user-defined function, saving the response to a variable, testing the variable, and then returning true or false.</p>
<p>confirm() returns a true or false anyway, so the whole thing could be reduced to:</p>
<p>&lt;input type=&#034;submit&#034; value=&#034;Delete&#034;  onClick=&#034;return confirm(&#039;Are you sure?&#039;)&#034; &gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.306 seconds -->
