<?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>In Search of a Good Title &#187; jQuery</title>
	<atom:link href="http://curtis.humphreyonline.us/category/code/jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://curtis.humphreyonline.us</link>
	<description>Curtis M. Humphrey's Website</description>
	<lastBuildDate>Wed, 07 Sep 2011 18:05:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>A problem with jQuery&#8217;s .serialize() and the answer</title>
		<link>http://curtis.humphreyonline.us/code/jquery/serialize-function-problem-and-answer</link>
		<comments>http://curtis.humphreyonline.us/code/jquery/serialize-function-problem-and-answer#comments</comments>
		<pubDate>Sun, 18 Jan 2009 01:33:16 +0000</pubDate>
		<dc:creator>Curtis M. Humphrey</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://curtis.humphreyonline.us/?p=27</guid>
		<description><![CDATA[I was having a problem with the jQuery .serialize() function and the good news is that I found the answer to this problem. The Problem The jQuery .serialize() function was returning &#8220;&#8221; or nothing. Not what I wanted to say the least. Here was the setup. I was using .serialize() like this: ... $(this).parents('.ARow').serialize() ... [...]


Related posts:<ol><li><a href='http://curtis.humphreyonline.us/code/jquery/grabbing-a-subsection-of-input-field-values' rel='bookmark' title='Permanent Link: Grabbing a subsection of input field values'>Grabbing a subsection of input field values</a></li>
<li><a href='http://curtis.humphreyonline.us/code/wordpress/comparing-file-download-managers' rel='bookmark' title='Permanent Link: Comparing File Download Managers'>Comparing File Download Managers</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was having a problem with the <a href="http://jquery.com/" target="_blank">jQuery</a> <a href="http://docs.jquery.com/Ajax/serialize" target="_blank">.serialize()</a> function and the good news is that I found the answer to this problem.</p>
<p><strong>The Problem</strong><br />
The jQuery .serialize() function was returning &#8220;&#8221; or nothing. Not what I wanted to say the least. Here was the setup. I was using .serialize() like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript-jquery" style="font-family:monospace;">...
$(this).parents('.ARow').serialize()
...</pre></div></div>

<p>and the xhtml was:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ARow&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;food_state&quot;</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;NewFoodState&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Add New Food State&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></pre></div></div>

<p><strong>The Answer</strong><br />
The problem was that .serialize() outputted &#8220;&#8221;. The answer was that if an input does not have a &#8220;name&#8221; field then .serialize() skips it. Of course that makes sense but sometime simple reasons can be overlooked. Therefore when the xhtml is updated to:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ARow&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;food_state&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;food_state&quot;</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;NewFoodState&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Add New Food State&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></pre></div></div>

<p>The output of .serialize() becomes, as desired, &#8220;food_state: raw&#8221;. I hope this helps someone else.</p>
<p>This page is using: [download id="1"]</p>


<p>Related posts:<ol><li><a href='http://curtis.humphreyonline.us/code/jquery/grabbing-a-subsection-of-input-field-values' rel='bookmark' title='Permanent Link: Grabbing a subsection of input field values'>Grabbing a subsection of input field values</a></li>
<li><a href='http://curtis.humphreyonline.us/code/wordpress/comparing-file-download-managers' rel='bookmark' title='Permanent Link: Comparing File Download Managers'>Comparing File Download Managers</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://curtis.humphreyonline.us/code/jquery/serialize-function-problem-and-answer/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Grabbing a subsection of input field values</title>
		<link>http://curtis.humphreyonline.us/code/jquery/grabbing-a-subsection-of-input-field-values</link>
		<comments>http://curtis.humphreyonline.us/code/jquery/grabbing-a-subsection-of-input-field-values#comments</comments>
		<pubDate>Thu, 15 Jan 2009 00:43:49 +0000</pubDate>
		<dc:creator>Curtis M. Humphrey</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://curtis.humphreyonline.us/?p=19</guid>
		<description><![CDATA[I was looking for a jQuery way of grabbing the values of a subsection of input fields. I know it is more complicated then just getting the $().val() of items because of selection elements. I found the plugin called Values but it was a bit more than I needed. I only need to get values [...]


Related posts:<ol><li><a href='http://curtis.humphreyonline.us/code/jquery/serialize-function-problem-and-answer' rel='bookmark' title='Permanent Link: A problem with jQuery&#8217;s .serialize() and the answer'>A problem with jQuery&#8217;s .serialize() and the answer</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was looking for a jQuery way of grabbing the values of a subsection of input fields. I know it is more complicated then just getting the $().val() of items because of selection elements. I found the plugin called <a href="http://plugins.jquery.com/project/Values" target="_blank">Values</a> but it was a bit more than I needed. I only need to get values not to set them. Plus I don&#8217;t want to get values from elements other than inputs, so there is no need to have the function grab text when it cannot find values. So for now I will use this plugin but I want to modify it in the future to serve this narrow purpose. (I like small clean simple code and not bloat).</p>
<p>&#8211;some time later&#8211;<br />
Lol. It appears that sometimes the solution is right there and I over think the problem. I can do what I wanted to do with this simple line:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'container class'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input, select'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Well problem solved, on to the next one <img src='http://curtis.humphreyonline.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>


<p>Related posts:<ol><li><a href='http://curtis.humphreyonline.us/code/jquery/serialize-function-problem-and-answer' rel='bookmark' title='Permanent Link: A problem with jQuery&#8217;s .serialize() and the answer'>A problem with jQuery&#8217;s .serialize() and the answer</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://curtis.humphreyonline.us/code/jquery/grabbing-a-subsection-of-input-field-values/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

