<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Adding form fields via ajax with Mootools</title>
	<atom:link href="http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/</link>
	<description>blog : my thoughts, scripts, events and comments....</description>
	<lastBuildDate>Sat, 21 Jan 2012 11:09:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Chris</title>
		<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/comment-page-1/#comment-474</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Sat, 19 Mar 2011 09:29:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cbolson.com/?p=149#comment-474</guid>
		<description>Hi,
Could you give a bit more detail regarding your issue?
The first thing to check is that your are sending the &quot;type&quot; correctly.

Chris</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Could you give a bit more detail regarding your issue?<br />
The first thing to check is that your are sending the &#8220;type&#8221; correctly.</p>
<p>Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harley</title>
		<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/comment-page-1/#comment-470</link>
		<dc:creator>Harley</dc:creator>
		<pubDate>Tue, 15 Mar 2011 22:55:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cbolson.com/?p=149#comment-470</guid>
		<description>Hmmm - what am I missing here - it&#039;s not printing the form elements

&lt;code&gt;&lt;?php

// check we have data
if(!isset($_GET[&quot;field_name&quot;])) die(&quot;error with data&quot;);
if(!isset($_GET[&quot;type&quot;]))        die(&quot;Error with data&quot;);

// define vars (should do more checking here)
$field_name    =    $_GET[&quot;field_name&quot;];
$form_type    =    $_GET[&quot;type&quot;];
$num        =    $_GET[&quot;num&quot;];

switch($form_type){
 case &quot;item&quot;:
 echo &#039;
 
 
 Table &#039;.$num.&#039;
 Image
 
 
 
 Title
 
 
 
 Color
 
 
 White
 Red
 Blue
 Yellow
 
 
 
 
 Description
 
 
 
 &#039;;
 break;
 default:
 echo &quot;nothing doing, sorry&quot;;
 break;
}


?&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hmmm &#8211; what am I missing here &#8211; it&#8217;s not printing the form elements</p>
<p><code>&lt;?php</p>
<p>// check we have data<br />
if(!isset($_GET[&quot;field_name&quot;])) die(&quot;error with data&quot;);<br />
if(!isset($_GET[&quot;type&quot;]))        die(&quot;Error with data&quot;);</p>
<p>// define vars (should do more checking here)<br />
$field_name    =    $_GET[&quot;field_name&quot;];<br />
$form_type    =    $_GET[&quot;type&quot;];<br />
$num        =    $_GET[&quot;num&quot;];</p>
<p>switch($form_type){<br />
 case &quot;item&quot;:<br />
 echo &#039;</p>
<p> Table '.$num.'<br />
 Image</p>
<p> Title</p>
<p> Color</p>
<p> White<br />
 Red<br />
 Blue<br />
 Yellow</p>
<p> Description</p>
<p> ';<br />
 break;<br />
 default:<br />
 echo "nothing doing, sorry";<br />
 break;<br />
}</p>
<p>?&gt;</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Azraf</title>
		<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/comment-page-1/#comment-279</link>
		<dc:creator>Azraf</dc:creator>
		<pubDate>Sat, 09 Oct 2010 19:01:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cbolson.com/?p=149#comment-279</guid>
		<description>Nice one. Exactly this one I was searching ....</description>
		<content:encoded><![CDATA[<p>Nice one. Exactly this one I was searching &#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/comment-page-1/#comment-272</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Sun, 11 Jul 2010 11:40:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cbolson.com/?p=149#comment-272</guid>
		<description>Hi,
I don&#039;t qute follow what you want to do.
You can easily count the fields once the form has been posted with standard php code.
If you want some sort of counter as the rows are added, you need to do a combination of php and JavaScript (could be done with just JavaScript but you specifically mention php).  In fact, if I remember rightly, the javascript code already has a built in counter for making arrays, so maybe you could use that to output it to the page.
However, as I say, I don&#039;t really understand exactly what it is you want to do so it is hard to give a specific answer.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I don&#8217;t qute follow what you want to do.<br />
You can easily count the fields once the form has been posted with standard php code.<br />
If you want some sort of counter as the rows are added, you need to do a combination of php and JavaScript (could be done with just JavaScript but you specifically mention php).  In fact, if I remember rightly, the javascript code already has a built in counter for making arrays, so maybe you could use that to output it to the page.<br />
However, as I say, I don&#8217;t really understand exactly what it is you want to do so it is hard to give a specific answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tony</title>
		<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/comment-page-1/#comment-271</link>
		<dc:creator>tony</dc:creator>
		<pubDate>Sun, 11 Jul 2010 11:16:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cbolson.com/?p=149#comment-271</guid>
		<description>I Want to post form fields with php
how to get the count of dynamic rows with php ?</description>
		<content:encoded><![CDATA[<p>I Want to post form fields with php<br />
how to get the count of dynamic rows with php ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/comment-page-1/#comment-173</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 31 Mar 2010 18:57:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cbolson.com/?p=149#comment-173</guid>
		<description>My demo uses Mootools 1.2.3 but there is nothing in there which would prevent it from working in the latest version.

The fields can be prefilled with database info, infact that was the very reason that I did this in the first place.  The code needed to be able to retrieve form data according to options defined by the user.
Getting the data into to the forms just needs to be done in the php ajax file as per a normal query.  They only thing that you might need to alter is to send the &quot;id&quot; of the user to the php file via the ajax call.</description>
		<content:encoded><![CDATA[<p>My demo uses Mootools 1.2.3 but there is nothing in there which would prevent it from working in the latest version.</p>
<p>The fields can be prefilled with database info, infact that was the very reason that I did this in the first place.  The code needed to be able to retrieve form data according to options defined by the user.<br />
Getting the data into to the forms just needs to be done in the php ajax file as per a normal query.  They only thing that you might need to alter is to send the &#8220;id&#8221; of the user to the php file via the ajax call.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/comment-page-1/#comment-172</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Wed, 31 Mar 2010 16:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cbolson.com/?p=149#comment-172</guid>
		<description>Thank you for the quick response. I am going to try to adapt this for a set of forms inside of a Joomla environment. What version of Mootools are you using in this example? 

Also, I was curious if it would be possible to pre-fill the questions with user responses stored in a db including the dynamically returned questions? Or asked a different way, do the dynamic fields become a lasting part of the form that can be recalled later?</description>
		<content:encoded><![CDATA[<p>Thank you for the quick response. I am going to try to adapt this for a set of forms inside of a Joomla environment. What version of Mootools are you using in this example? </p>
<p>Also, I was curious if it would be possible to pre-fill the questions with user responses stored in a db including the dynamically returned questions? Or asked a different way, do the dynamic fields become a lasting part of the form that can be recalled later?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/comment-page-1/#comment-170</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 31 Mar 2010 07:24:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cbolson.com/?p=149#comment-170</guid>
		<description>The quick and simple answer is because it is numeric and not a string.  If you put a number within quotes it becomes a string and that can cause prblems when you need to do mathamatical solutions.

It is a while since I put that code together, and in fact for the demo and for basic purposes that argument is not needed, to get something like this to work you probably only need to pass the &quot;type&quot;.</description>
		<content:encoded><![CDATA[<p>The quick and simple answer is because it is numeric and not a string.  If you put a number within quotes it becomes a string and that can cause prblems when you need to do mathamatical solutions.</p>
<p>It is a while since I put that code together, and in fact for the demo and for basic purposes that argument is not needed, to get something like this to work you probably only need to pass the &#8220;type&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dou</title>
		<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/comment-page-1/#comment-169</link>
		<dc:creator>Dou</dc:creator>
		<pubDate>Wed, 31 Mar 2010 02:42:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cbolson.com/?p=149#comment-169</guid>
		<description>Thanks so much for this! I am trying to learn AJAX and your article has helped immensely. I was wondering though why in the data being passed with the request the num:counter were not quoted like &#039;type&#039; and &#039;field_name&#039;?</description>
		<content:encoded><![CDATA[<p>Thanks so much for this! I am trying to learn AJAX and your article has helped immensely. I was wondering though why in the data being passed with the request the num:counter were not quoted like &#8216;type&#8217; and &#8216;field_name&#8217;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://blog.cbolson.com/adding-form-fields-via-ajax-with-mootools/comment-page-1/#comment-128</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Tue, 02 Feb 2010 19:02:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cbolson.com/?p=149#comment-128</guid>
		<description>Hi, I&#039;m afraid I don&#039;t &quot;do&quot; Java, but feel free to have a go.... ;)</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m afraid I don&#8217;t &#8220;do&#8221; Java, but feel free to have a go&#8230;. <img src='http://blog.cbolson.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

