<?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>Gudasoft &#187; javascript</title>
	<atom:link href="http://www.gudasoft.com/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gudasoft.com</link>
	<description>Impossible is nothing</description>
	<lastBuildDate>Mon, 26 Jul 2010 10:22:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>A lot of Javascript this days</title>
		<link>http://www.gudasoft.com/uncategorized/02/18/1229/a-lot-of-javascript-this-days/2010</link>
		<comments>http://www.gudasoft.com/uncategorized/02/18/1229/a-lot-of-javascript-this-days/2010#comments</comments>
		<pubDate>Thu, 18 Feb 2010 20:16:00 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1229</guid>
		<description><![CDATA[I am migrating to jQuery and found this wonderfull tutorial on their webpage. A must read for anyone which pretend to know js. http://docs.jquery.com/Types]]></description>
			<content:encoded><![CDATA[<p>I am migrating to jQuery and found this wonderfull tutorial on their webpage.<br />
A must read for anyone which pretend to know js.</p>
<p>http://docs.jquery.com/Types</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/uncategorized/02/18/1229/a-lot-of-javascript-this-days/2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript in the window.name</title>
		<link>http://www.gudasoft.com/english/development/javascript/07/07/83/javascript-in-the-windowname/2008</link>
		<comments>http://www.gudasoft.com/english/development/javascript/07/07/83/javascript-in-the-windowname/2008#comments</comments>
		<pubDate>Mon, 07 Jul 2008 09:37:05 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=83</guid>
		<description><![CDATA[Wow. What a nice idea. http://code.google.com/p/quipt/ Note: if you want to make the test.html to work checkout and test on http://&#8230; it is some beta but it works great only in Firefox]]></description>
			<content:encoded><![CDATA[<p>Wow. What a nice idea.</p>
<p>http://code.google.com/p/quipt/</p>
<p>Note: if you want to make the test.html to work checkout and test on http://&#8230; it is some beta but it works great only in Firefox</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/javascript/07/07/83/javascript-in-the-windowname/2008/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy checkboxes from one form to another with Prototype</title>
		<link>http://www.gudasoft.com/uncategorized/06/23/75/copy-checkbox-values-from-one-form-to-another-with-prototype/2008</link>
		<comments>http://www.gudasoft.com/uncategorized/06/23/75/copy-checkbox-values-from-one-form-to-another-with-prototype/2008#comments</comments>
		<pubDate>Mon, 23 Jun 2008 08:04:31 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=75</guid>
		<description><![CDATA[I have a case where the user must select items from a basket and use them with different forms. Example: Some items in this form Item: Item: Item: Item: Another form here (I will create here hidden fields from the the checkboxes in the first box) I will show you how to use the checked [...]]]></description>
			<content:encoded><![CDATA[<p>I have a case where the user must select items from a basket and use them with different forms.</p>
<div style="clear: both">Example:</div>
<fieldset style="float: left; width: 30%">
<legend>Some items in this form</legend>
<ul>
<li> Item:<br />
<input type="checkbox" /></li>
<li> Item:<br />
<input type="checkbox" /></li>
<li> Item:<br />
<input type="checkbox" /></li>
<li> Item:<br />
<input type="checkbox" /></li>
<li>
<input name="Action 1" type="submit" value="Action 1" /></li>
</ul>
</fieldset>
<fieldset style="float: left; width: 30%">
<legend>Another form here</legend>
<div>(I will create here hidden fields from the the checkboxes in the first box)</div>
<input name="Action 2" type="submit" value="Another action" />
</fieldset>
<div style="clear: both">I will show you how to use the checked boxes from the first form with the submit action in the second form</div>
<p>It would be easy if the form could be one &#8211; less support.</p>
<p>I am starting with those two forms</p>
<ul>
<li>Helper form &#8211; Form with checkboxes</li>
<li>Action form &#8211; the form that will do the real action based on the selected items in the helper form</li>
</ul>
<p>Here is how it looks the helper form. All the checkboxes are tagged with the class=&#8221;selectable&#8221;. Here is rails example but you can implement it pure html.</p>
<pre>
<div>&lt;%= check_box_tag('selected[]', true, image.selected?, :class=&gt;"selectable") %&gt;</div>
</pre>
<p>Then we can select all the checkboxes with this javascript.</p>
<p><code>var make_to_hidden = $$('input.selectable');<br />
</code></p>
<p>Put on your action form an id so we can access it easy in this case:</p>
<p><code> </code></p>
<pre>
<form id="mail_form">&lt;form id="mail_form" onsubmit="import_selected_basket()"&gt;
	...
&lt;/form&gt;
</form>
</pre>
<p>Lets add those checkboxes from the first form to the real action form with this javascript function<br />
<code> </code></p>
<pre>      function import_selected_basket() {
          var make_to_hidden = $$('input.selectable');
          make_to_hidden.each(function(item) {
              if (item.checked) {
                var new_item = new Element('input', { 'type': 'hidden', name: item.name, value: item.value })
                $('mail_form').appendChild(new_item)
              }
          });
<script type="text/javascript"><!--mce:0--></script></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/uncategorized/06/23/75/copy-checkbox-values-from-one-form-to-another-with-prototype/2008/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
