<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>betweenGo &#187; JavaScript</title>
	<atom:link href="http://betweengo.com/category/web/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://betweengo.com</link>
	<description>We make Ruby on Rails easy.  We make ATG easy.</description>
	<lastBuildDate>Tue, 06 Dec 2011 14:03:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JavaScript Invalid Argument in Internet Explorer Only</title>
		<link>http://betweengo.com/2009/08/11/javascript-invalid-argument-internet-explorer-only/</link>
		<comments>http://betweengo.com/2009/08/11/javascript-invalid-argument-internet-explorer-only/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 01:09:43 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=813</guid>
		<description><![CDATA[Today I noticed one of my links were not working.  This was only happening in Internet Explorer 8.  Looking down at the status bar in the lower left corner I saw the message “Error on page.”  Double-clicking on it popped up this window full of useless information. A Google search for “internet explorer invalid argument” [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/03/17/unobtrusive-javascript/' rel='bookmark' title='Unobtrusive JavaScript'>Unobtrusive JavaScript</a></li>
<li><a href='http://betweengo.com/2005/08/08/internet-explorer-form-does-not-invoke-atg-handler/' rel='bookmark' title='Internet Explorer form does not invoke ATG handler'>Internet Explorer form does not invoke ATG handler</a></li>
<li><a href='http://betweengo.com/2009/08/16/twitter-weekly-updates-for-2009-08-16/' rel='bookmark' title='Twitter Weekly Updates for 2009-08-16'>Twitter Weekly Updates for 2009-08-16</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today I noticed one of my links were not working.  This was only happening in <a title="Internet Explorer 8 - Wikipedia" href="http://en.wikipedia.org/wiki/Internet_Explorer_8">Internet Explorer 8</a>.  Looking down at the status bar in the lower left corner I saw the message “Error on page.”  Double-clicking on it popped up this window full of <em>useless</em> information.</p>
<p><a href="http://betweengo.com/wp-content/uploads/2009/08/internet-explorer-8-invalid-argument.png"><img class="aligncenter size-medium wp-image-814" title="Internet Explorer 8 invalid argument JavaScript error" src="http://betweengo.com/wp-content/uploads/2009/08/internet-explorer-8-invalid-argument-500x326.png" alt="Internet Explorer 8 invalid argument JavaScript error" width="500" height="326" /></a></p>
<p>A Google search for “<a title="internet explorer invalid argument - Google Search" href="http://www.google.com/search?q=internet+explorer+invalid+argument">internet explorer invalid argument</a>” brought me to this page, <a title="Internet Explorer Sucks | firsttube.com" href="http://firsttube.com/read/Internet-Explorer-Sucks/">Internet Explorer Sucks</a>.  Fortunately the author had run into this problem and figured out the solution.</p>
<p>It turns out In Internet Explorer, <strong>the second argument to the JavaScript <a title="Using the window open method" href="http://www.javascript-coder.com/window-popup/javascript-window-open.phtml"><tt>window.open</tt></a> method, which is the <tt>windowName</tt> argument, can’t have spaces.</strong> My original link looked like this.</p>
<pre>&lt;a href="javascript:void(0);" onclick="window.open('popUp.jsp','Frank Kim betweenGo','menubar=0,toolbar=0,location=0,scrollbars=yes,width=400,height=175')"&gt;What's this?&lt;/a&gt;</pre>
<p>When I took out the spaces from the <tt>windowName</tt> argument the link worked.   <strong>You would think Internet Explorer 8 would have fixed this issue by now, it doesn&#8217;t affect any other <em>modern</em> web browser.</strong></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F08%2F11%2Fjavascript-invalid-argument-internet-explorer-only%2F&amp;title=JavaScript%20Invalid%20Argument%20in%20Internet%20Explorer%20Only" id="wpa2a_2"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/03/17/unobtrusive-javascript/' rel='bookmark' title='Unobtrusive JavaScript'>Unobtrusive JavaScript</a></li>
<li><a href='http://betweengo.com/2005/08/08/internet-explorer-form-does-not-invoke-atg-handler/' rel='bookmark' title='Internet Explorer form does not invoke ATG handler'>Internet Explorer form does not invoke ATG handler</a></li>
<li><a href='http://betweengo.com/2009/08/16/twitter-weekly-updates-for-2009-08-16/' rel='bookmark' title='Twitter Weekly Updates for 2009-08-16'>Twitter Weekly Updates for 2009-08-16</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/08/11/javascript-invalid-argument-internet-explorer-only/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Unobtrusive JavaScript</title>
		<link>http://betweengo.com/2009/03/17/unobtrusive-javascript/</link>
		<comments>http://betweengo.com/2009/03/17/unobtrusive-javascript/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 20:02:54 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=675</guid>
		<description><![CDATA[Unobtrusive JavaScript&#8217;s goal is to move all the functionality (the Controller) out of the HTML (the Model) and the CSS (the View).  This is also called full MVC separation. This is how typically JavaScript and HTML mix.  For example in submitting a form using a text link. &#60;a href="javascript:submit(document.testForm)"&#62;Submit&#60;/a&#62; Or for jumping to different parts [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/' rel='bookmark' title='Submitting an ATG Form Using a Text Link'>Submitting an ATG Form Using a Text Link</a></li>
<li><a href='http://betweengo.com/2007/04/28/submitting-form-with-radio-button/' rel='bookmark' title='Submitting a form with a radio button'>Submitting a form with a radio button</a></li>
<li><a href='http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/' rel='bookmark' title='Jumping to different parts of a page using a dropdown'>Jumping to different parts of a page using a dropdown</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Unobtrusive JavaScript&#8217;s goal is to move all the functionality (the Controller) out of the HTML (the Model) and the CSS (the View).  This is also called full MVC separation.</p>
<p>This is how typically JavaScript and HTML mix.  For example in <a title=" Submitting an ATG Form Using a Text Link" href="http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/">submitting a form using a text link</a>.</p>
<pre>&lt;a href="javascript:submit(document.testForm)"&gt;Submit&lt;/a&gt;</pre>
<p>Or for <a title=" Jumping to different parts of a page using a dropdown" href="../2008/07/17/jumping-within-page-from-dropdown/">jumping to different parts of a page using a dropdown</a>.</p>
<pre> &lt;input type="image" src="/img/buttons/update.gif"
   onClick="window.location.hash=
document.jumpTo.names.options[document.jumpTo.names.selectedIndex].value"&gt;</pre>
<p>Using the unobtrusive JavaScript technique one can separate the JavaScript from the HTML.</p>
<pre>&lt;div id="foo"&gt;Submit&lt;/div&gt;

&lt;script type="text/javascript"&gt;
 Event.observe($('foo'), 'click', function(event) {
   $(Event.element(event)).form.submit();
   return false;
 });
&lt;/script&gt;</pre>
<p>We use the <a title="Protoculous : Prototype &amp; Scriptaculous lightweight !" href="http://protoculous.wikeo.be/">Protoculous</a> JavaScript file which combines the <a title="Prototype JavaScript Framework" href="http://prototypejs.org/api">Prototype</a> framework and <a title="script.aculo.us - web 2.0 javascript" href="http://script.aculo.us/">Scriptaculous</a> libraries to do unobtrusive JavaScript.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F03%2F17%2Funobtrusive-javascript%2F&amp;title=Unobtrusive%20JavaScript" id="wpa2a_4"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/' rel='bookmark' title='Submitting an ATG Form Using a Text Link'>Submitting an ATG Form Using a Text Link</a></li>
<li><a href='http://betweengo.com/2007/04/28/submitting-form-with-radio-button/' rel='bookmark' title='Submitting a form with a radio button'>Submitting a form with a radio button</a></li>
<li><a href='http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/' rel='bookmark' title='Jumping to different parts of a page using a dropdown'>Jumping to different parts of a page using a dropdown</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/03/17/unobtrusive-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Undefined</title>
		<link>http://betweengo.com/2009/02/26/undefined/</link>
		<comments>http://betweengo.com/2009/02/26/undefined/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 21:42:20 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=445</guid>
		<description><![CDATA[(Photo: Nouveau Variation by Syntopia) I find the undefined keyword and identity operators (=== and !==) in JavaScript pretty useful.&#160; For example if I am parsing a JSON input and I am not sure if something is there or not I test it like this. if (root.Foo === undefined) If I want to test if [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2005/07/28/user-defined-property-type-gotchas/' rel='bookmark' title='user-defined property type gotcha&#8217;s'>user-defined property type gotcha&#8217;s</a></li>
<li><a href='http://betweengo.com/2007/04/28/submitting-form-with-radio-button/' rel='bookmark' title='Submitting a form with a radio button'>Submitting a form with a radio button</a></li>
<li><a href='http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/' rel='bookmark' title='Submitting an ATG Form Using a Text Link'>Submitting an ATG Form Using a Text Link</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://www.flickr.com/photos/syntopia/3573620167/"><img title="Nouveau Variation on Flickr" alt="Nouveau Variation on Flickr" src="http://farm4.static.flickr.com/3582/3573620167_976f03c0a7.jpg" /></a></p>
<p align="center">(Photo: <a title="Nouveau Variation on Flickr" href="http://www.flickr.com/photos/syntopia/3573620167/">Nouveau Variation</a> by <a title="Flickr: Syntopia&#39;s Photostream" href="http://www.flickr.com/photos/syntopia/">Syntopia</a>) </p>
<p>I find the undefined keyword and identity operators (=== and !==) in JavaScript pretty useful.&#160; For example if I am parsing a JSON input and I am not sure if something is there or not I test it like this.</p>
<pre>if (root.Foo === undefined)</pre>
<p>If I want to test if something is defined I do it like this.</p>
<pre>if (root.Bar !== undefined)</pre>
<p>saladwithsteve explains it well in his <a title="JavaScript undefined vs. null" href="http://saladwithsteve.com/2008/02/javascript-undefined-vs-null.html">JavaScript undefined vs. null</a> post.</p>
<p><strong>Update 12-14-2009: </strong>Unfortunately the above method did not work for testing a variable directly.&#160; I ended up following the advice of this post, <a title="Javascript IsDefined Function" href="http://jehiah.cz/archive/javascript-isdefined-function">Javascript IsDefined Function</a>.&#160; To test if a variable is defined I now do this.</p>
<pre>if (typeof(foo) != &quot;undefined&quot;)</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F02%2F26%2Fundefined%2F&amp;title=Undefined" id="wpa2a_6"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2005/07/28/user-defined-property-type-gotchas/' rel='bookmark' title='user-defined property type gotcha&#8217;s'>user-defined property type gotcha&#8217;s</a></li>
<li><a href='http://betweengo.com/2007/04/28/submitting-form-with-radio-button/' rel='bookmark' title='Submitting a form with a radio button'>Submitting a form with a radio button</a></li>
<li><a href='http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/' rel='bookmark' title='Submitting an ATG Form Using a Text Link'>Submitting an ATG Form Using a Text Link</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/02/26/undefined/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jumping to different parts of a page using a dropdown</title>
		<link>http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/</link>
		<comments>http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 19:17:17 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Page Development]]></category>
		<category><![CDATA[ATG]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=210</guid>
		<description><![CDATA[It is relatively simple to dynamically create a dropdown from which you can jump to different parts of a page using JavaScript and ATG DSPEL. First create the dropdown. &#60;form name="jumpTo" action="."&#62; &#60;dspel:droplet name="/atg/dynamo/droplet/ForEach"&#62; &#60;dspel:param name="array" param="categories"/&#62; &#60;dspel:setvalue param="category" paramvalue="element"/&#62; &#60;dspel:oparam name="outputStart"&#62; &#60;select name="names"&#62; &#60;/dspel:oparam&#62; &#60;dspel:oparam name="output"&#62; &#60;dspel:getvalueof id="index" param="index"/&#62; &#60;c:set var="catShortName" value="cat${index}"/&#62; &#60;option value="&#60;c:out [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
<li><a href='http://betweengo.com/2009/03/17/unobtrusive-javascript/' rel='bookmark' title='Unobtrusive JavaScript'>Unobtrusive JavaScript</a></li>
<li><a href='http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/' rel='bookmark' title='ATG ForEach Output with Separators Between Items'>ATG ForEach Output with Separators Between Items</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It is relatively simple to dynamically create a dropdown from which you can jump to different parts of a page using JavaScript and ATG DSPEL.</p>
<p>First create the dropdown.</p>
<pre>&lt;form name="jumpTo" action="."&gt;
  &lt;dspel:droplet name="/atg/dynamo/droplet/ForEach"&gt;
    &lt;dspel:param name="array" param="categories"/&gt;
    &lt;dspel:setvalue param="category" paramvalue="element"/&gt;
    &lt;dspel:oparam name="outputStart"&gt;
      &lt;select name="names"&gt;
    &lt;/dspel:oparam&gt;
    &lt;dspel:oparam name="output"&gt;
      &lt;dspel:getvalueof id="index" param="index"/&gt;
      &lt;c:set var="catShortName" value="cat${index}"/&gt;
      &lt;option value="&lt;c:out value="${catShortName}"/&gt;"&gt;
        &lt;dspel:valueof param="category.name"/&gt;
      &lt;/option&gt;
    &lt;/dspel:oparam&gt;
    &lt;dspel:oparam name="outputEnd"&gt;
      &lt;/select&gt;
    &lt;/dspel:oparam&gt;
  &lt;/dspel:droplet&gt;
&lt;/form&gt;</pre>
<p>Next create the button <em>outside</em> of the form for jumping to different parts of the page.  I learned about the window.location.hash from this <a title="BRADINO  » Jump to Location Within Page" href="http://www.bradino.com/javascript/jump-to-location-within-page/">article</a>.  And I learned about how to access the selected value from the dropdown from this <a title="JavaScript Drop Down Boxes" href="http://www.pageresource.com/jscript/jdropbox.htm">article</a>.</p>
<pre> &lt;input type="image" src="/img/buttons/update.gif"
   onClick="window.location.hash=
document.jumpTo.names.options[document.jumpTo.names.selectedIndex].value"&gt;</pre>
<p>Finally you create the name anchors throughout your document.</p>
<pre>&lt;dspel:droplet name="/atg/dynamo/droplet/ForEach"&gt;
  &lt;dspel:param name="array" param="categories"/&gt;
  &lt;dspel:setvalue param="category" paramvalue="element"/&gt;
  &lt;dspel:oparam name="output"&gt;

    &lt;%-- magazine category --%&gt;
    &lt;dspel:getvalueof id="index" param="index"/&gt;
    &lt;c:set var="catShortName" value="cat${index}"/&gt;
    &lt;a name="&lt;c:out value="${catShortName}"/&gt;"
       id="&lt;c:out value="${catShortName}"/&gt;"&gt;
      &lt;dspel:valueof param="category.name"/&gt;
    &lt;/a&gt;

  &lt;/dspel:oparam&gt;
&lt;/dspel:droplet&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2008%2F07%2F17%2Fjumping-within-page-from-dropdown%2F&amp;title=Jumping%20to%20different%20parts%20of%20a%20page%20using%20a%20dropdown" id="wpa2a_8"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
<li><a href='http://betweengo.com/2009/03/17/unobtrusive-javascript/' rel='bookmark' title='Unobtrusive JavaScript'>Unobtrusive JavaScript</a></li>
<li><a href='http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/' rel='bookmark' title='ATG ForEach Output with Separators Between Items'>ATG ForEach Output with Separators Between Items</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Submitting an ATG Form Using a Text Link</title>
		<link>http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/</link>
		<comments>http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 11:37:55 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Form Handlers]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Page Development]]></category>
		<category><![CDATA[ATG]]></category>

		<guid isPermaLink="false">http://betweengo.com/uncategorized/2007/07/20/submitting-an-atg-form-using-a-text-link/</guid>
		<description><![CDATA[It has always bedeviled me how to submit an ATG form using a text link. I have asked many people about this but no one seems to know. Finally with the help of ATG support I figured it out. Below is a simple example of how to do it. The trick is the hidden submit [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2005/08/08/internet-explorer-form-does-not-invoke-atg-handler/' rel='bookmark' title='Internet Explorer form does not invoke ATG handler'>Internet Explorer form does not invoke ATG handler</a></li>
<li><a href='http://betweengo.com/2005/08/08/atg-forms-do-not-work-if-action-is-an-html-page/' rel='bookmark' title='ATG forms do not work if action is an HTML page'>ATG forms do not work if action is an HTML page</a></li>
<li><a href='http://betweengo.com/2007/04/28/submitting-form-with-radio-button/' rel='bookmark' title='Submitting a form with a radio button'>Submitting a form with a radio button</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It has always bedeviled me how to submit an ATG form using a text link. I have asked many people about this but no one seems to know. Finally with the help of ATG support I figured it out.</p>
<p>Below is a simple example of how to do it. The trick is the hidden submit input which triggers ATG to call the <tt>handleSubmit</tt> method of the form handler.</p>
<pre>&lt;%@ taglib uri="/dspTaglib" prefix="dsp"%&gt;

&lt;dsp:page&gt;

&lt;script&gt;
  function submit(form) {
    form.submit();
  }
&lt;/script&gt;

&lt;dsp:form action="&lt;%=request.getRequestURI()%&gt;" method="post" name="testForm"&gt;

  Foo: &lt;dsp:input type="text" bean="TestFormHandler.foo"/&gt;

  &lt;p&gt;&lt;a href="javascript:submit(document.testForm)"&gt;Submit&lt;/a&gt;

  &lt;dsp:input type="hidden" bean="TestFormHandler.submit" value="Submit"/&gt;

&lt;/dsp:form&gt;

&lt;/dsp:page&gt;</pre>
<p>You can also invoke the JavaScript like this:</p>
<pre>  &lt;p&gt;&lt;a href="#" onclick="submit(document.testForm); return false;"&gt;Submit&lt;/a&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2007%2F07%2F20%2Fsubmitting-an-atg-form-using-a-text-link%2F&amp;title=Submitting%20an%20ATG%20Form%20Using%20a%20Text%20Link" id="wpa2a_10"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2005/08/08/internet-explorer-form-does-not-invoke-atg-handler/' rel='bookmark' title='Internet Explorer form does not invoke ATG handler'>Internet Explorer form does not invoke ATG handler</a></li>
<li><a href='http://betweengo.com/2005/08/08/atg-forms-do-not-work-if-action-is-an-html-page/' rel='bookmark' title='ATG forms do not work if action is an HTML page'>ATG forms do not work if action is an HTML page</a></li>
<li><a href='http://betweengo.com/2007/04/28/submitting-form-with-radio-button/' rel='bookmark' title='Submitting a form with a radio button'>Submitting a form with a radio button</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Submitting a form with a radio button</title>
		<link>http://betweengo.com/2007/04/28/submitting-form-with-radio-button/</link>
		<comments>http://betweengo.com/2007/04/28/submitting-form-with-radio-button/#comments</comments>
		<pubDate>Sat, 28 Apr 2007 15:46:29 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[Struts]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=108</guid>
		<description><![CDATA[Submitting a form from a radio button is not common but it is a nice UI which is even better when done with AJAX. A typical form with two radio buttons would look something like this. &#60;form action="test.html"&#62; 1 &#60;input type="radio" name="test" value ="1"&#62;&#60;br&#62; 2 &#60;input type="radio" name="test" value ="2"&#62; &#60;p&#62;&#60;input type="submit" value="submit"&#62; &#60;/form&#62; 1 [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/' rel='bookmark' title='Submitting an ATG Form Using a Text Link'>Submitting an ATG Form Using a Text Link</a></li>
<li><a href='http://betweengo.com/2005/08/08/atg-forms-do-not-work-if-action-is-an-html-page/' rel='bookmark' title='ATG forms do not work if action is an HTML page'>ATG forms do not work if action is an HTML page</a></li>
<li><a href='http://betweengo.com/2005/08/08/internet-explorer-form-does-not-invoke-atg-handler/' rel='bookmark' title='Internet Explorer form does not invoke ATG handler'>Internet Explorer form does not invoke ATG handler</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Submitting a form from a radio button is not common but it is a nice UI which is even better when done with AJAX.</p>
<p>A typical form with two radio buttons would look something like this.</p>
<pre>&lt;form action="test.html"&gt;
1 &lt;input type="radio" name="test" value ="1"&gt;&lt;br&gt;
2 &lt;input type="radio" name="test" value ="2"&gt;
&lt;p&gt;&lt;input type="submit" value="submit"&gt;
&lt;/form&gt;</pre>
<table border="1" cellpadding="5">
<tbody>
<tr>
<td>
<form action="test.html"> 1</p>
<input name="test" type="radio" value="1" /> 2</p>
<input name="test" type="radio" value="2" />
<input type="submit" value="submit" />
</form>
</td>
</tr>
</tbody>
</table>
<p>But with basic JavaScript you can make a simpler form like this.</p>
<pre>&lt;script&gt;
function submitAction( form, absPath ) {
form.action = absPath;
form.submit();
}
&lt;/script&gt;
&lt;form action="test.html" id="test"&gt;
1 &lt;input type="radio" name="test" value ="1" onchange="submitAction(document.getElementById('test'), 'test.html')"&gt;&lt;br&gt;
2 &lt;input type="radio" name="test" value ="2" onchange="submitAction(document.getElementById('test'), 'test.html')"&gt;
&lt;/form&gt;</pre>
<table border="1" cellpadding="5">
<tbody>
<tr>
<td>
<form action="test.html"> 1</p>
<input name="test" type="radio" value="1" /> 2</p>
<input name="test" type="radio" value="2" />
<input type="submit" value="submit" />
</form>
</td>
</tr>
</tbody>
</table>
<p>If you are using Struts the above form&#8217;s JSP would be:</p>
<pre>&lt;html:form action="test.do" styleId="test"&gt;
1 &lt;input type="radio" name="test" value ="1" onchange="submitAction(document.getElementById('test'), 'test.do')"&gt;&lt;br&gt;
2 &lt;input type="radio" name="test" value ="2" onchange="submitAction(document.getElementById('test'), 'test.do')"&gt;
&lt;/html:form&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2007%2F04%2F28%2Fsubmitting-form-with-radio-button%2F&amp;title=Submitting%20a%20form%20with%20a%20radio%20button" id="wpa2a_12"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/' rel='bookmark' title='Submitting an ATG Form Using a Text Link'>Submitting an ATG Form Using a Text Link</a></li>
<li><a href='http://betweengo.com/2005/08/08/atg-forms-do-not-work-if-action-is-an-html-page/' rel='bookmark' title='ATG forms do not work if action is an HTML page'>ATG forms do not work if action is an HTML page</a></li>
<li><a href='http://betweengo.com/2005/08/08/internet-explorer-form-does-not-invoke-atg-handler/' rel='bookmark' title='Internet Explorer form does not invoke ATG handler'>Internet Explorer form does not invoke ATG handler</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2007/04/28/submitting-form-with-radio-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
