<?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>UnDeprived &#187; jEditable</title>
	<atom:link href="http://www.un-deprived.com/tag/jeditable/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.un-deprived.com</link>
	<description>A webdev journal of the Moninator</description>
	<lastBuildDate>Sun, 29 Aug 2010 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>jQuery Journal: jEditable &amp; PHP Basic — Step by Step</title>
		<link>http://www.un-deprived.com/2009/webdev/jquery-journal-jeditable-php-basic-step-by-step/</link>
		<comments>http://www.un-deprived.com/2009/webdev/jquery-journal-jeditable-php-basic-step-by-step/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 13:42:49 +0000</pubDate>
		<dc:creator>Mon</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[jEditable]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquery Journal]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.un-deprived.com/?p=132</guid>
		<description><![CDATA[jEditable passes values as $_POST as default It grabs the ID from the container as value to the $_POST. Example: &#60;div id=&#34;item01&#34;&#62;Editable text&#60;/div&#62; To retrieve: $id = $_POST[’id’] will return “item01″ – this is meant to be passing unique ID. An example would be the Primary Auto-increment ID. Set a class and delcare it to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<ol>
<li>jEditable passes values as $_POST as default</li>
<li>It grabs the ID from the container as value to the $_POST. Example: <span id="more-132"></span>
<div class="wp_syntax">
<div class="code">
<pre class="html" style="font-family:monospace;">&lt;div id=&quot;item01&quot;&gt;Editable text&lt;/div&gt;</pre>
</div>
</div>
<p>To retrieve: $id = $_POST[’id’] will return “item01″ – this is meant to be passing unique ID. An example would be the Primary Auto-increment ID.<!--more--></li>
<li>Set a class and delcare it to jEditable to make them editable. Example:
<div class="wp_syntax">
<div class="code">
<pre class="html" style="font-family:monospace;">&lt;div id=&quot;unique-id-1&quot; class=&quot;editable&quot;&gt;This is the editable text&lt;/div&gt;
&lt;div id=&quot;unique-id-2&quot; class=&quot;editable&quot;&gt;This is the editable text&lt;/div&gt;</pre>
</div>
</div>
</li>
<li>The HTML
<div class="wp_syntax">
<div class="code">
<pre class="html" style="font-family:monospace;">This is item 1
&nbsp;
This is item 2
&nbsp;
This is item 2</pre>
</div>
</div>
</li>
<li>Javascript:
<div class="wp_syntax">
<div class="code">
<pre class="javascript" style="font-family:monospace;">		$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.editable'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">editable</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'jedit.php'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #3366CC;">&quot;indicator&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'Saving...'</span><span style="color: #339933;">,</span>
                <span style="color: #3366CC;">&quot;tooltip&quot;</span>   <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Click to edit...&quot;</span><span style="color: #339933;">,</span>
                <span style="color: #3366CC;">&quot;type&quot;</span>		<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;textarea&quot;</span><span style="color: #339933;">,</span>
                <span style="color: #3366CC;">&quot;cancel&quot;</span>	<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Cancel&quot;</span><span style="color: #339933;">,</span>
                <span style="color: #3366CC;">&quot;submit&quot;</span>	<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Save&quot;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
</div>
</div>
</li>
<li> The PHP: jedit.php<br />
<strong><em>Note:</em></strong> <em>Must</em> re-echo the results for the<em> updated value(s)</em> to display the new value(s)</li>
<li>jEditable Configurations: you have the options to choose what to show up for an editable field. Such as a tooltip popup, what the submit button shows, or have a cancel button etc… you can see the full documentation on <a href="http://www.appelsiini.net/projects/jeditable" target="_blank">jEditable website</a>.</li>
</ol>
<p>If you want to pass multiple parameters, you can either use JSON or trick the ID to pass multiple fields. I have a hard time with JSON, so I tricked the ID part to pass multiple fields by using the PHP explode() function. For example:</p>
<div class="wp_syntax">
<div class="code">
<pre class="html" style="font-family:monospace;">&lt;div id=&quot;fieldname-&amp;lt;?=$id?&amp;gt;-tablename&quot; class=&quot;editable&quot;&gt;This is editable text&lt;/div&gt;</pre>
</div>
</div>
<p>Newb, but works.<!-- PHP 5.x --></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.un-deprived.com/2009/webdev/jquery-journal-jeditable-php-basic-step-by-step/feed/</wfw:commentRss>
		<slash:comments></slash:comments>
		</item>
	</channel>
</rss>
