<?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"
	>
<channel>
	<title>Comments on: Ajax Forms with jQuery</title>
	<atom:link href="http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/</link>
	<description>Doing That Web Standards Thing</description>
	<pubDate>Fri, 21 Nov 2008 11:05:38 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>By: Eduardo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1902</link>
		<dc:creator>Eduardo</dc:creator>
		<pubDate>Wed, 19 Nov 2008 01:41:21 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1902</guid>
		<description>@Trevor:
Thanks for your answer, it was kind of a similar problem.  However I fixed it by instead of using this in my php email script:

if(isset($_POST['mycheckbox']) {...}

using this:
if ($_POST['mycheckbox'] == "Yes") {...}

This is because for some reason jQuery always returns a value for "mycheckbox", probably "" &#60;-- empty, but isset then returns true. Not a problem within jQuery code at all, but it became an issue when processing my email script.

Maybe someone else will find this useful.</description>
		<content:encoded><![CDATA[<p>@Trevor:<br />
Thanks for your answer, it was kind of a similar problem.  However I fixed it by instead of using this in my php email script:</p>
<p>if(isset($_POST[&#8216;mycheckbox&#8217;]) {&#8230;}</p>
<p>using this:<br />
if ($_POST[&#8216;mycheckbox&#8217;] == &#8220;Yes&#8221;) {&#8230;}</p>
<p>This is because for some reason jQuery always returns a value for &#8220;mycheckbox&#8221;, probably &#8220;&#8221; &lt;&#8212; empty, but isset then returns true. Not a problem within jQuery code at all, but it became an issue when processing my email script.</p>
<p>Maybe someone else will find this useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1901</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 19 Nov 2008 01:19:37 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1901</guid>
		<description>@Eduardo-
Actually, this is a similar problem that &lt;a href="http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-979" rel="nofollow"&gt;Darrious&lt;/a&gt; had.

Check out the &lt;a href="http://trevordavis.net/play/jqueryajaxform/jquery-radio-buttons/" rel="nofollow"&gt;sample page&lt;/a&gt; or see &lt;a href="http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-980" rel="nofollow"&gt;my response to Darrious&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@Eduardo-<br />
Actually, this is a similar problem that <a href="http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-979" rel="nofollow">Darrious</a> had.</p>
<p>Check out the <a href="http://trevordavis.net/play/jqueryajaxform/jquery-radio-buttons/" rel="nofollow">sample page</a> or see <a href="http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-980" rel="nofollow">my response to Darrious</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduardo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1897</link>
		<dc:creator>Eduardo</dc:creator>
		<pubDate>Tue, 18 Nov 2008 21:30:35 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1897</guid>
		<description>Trevor:

I am having trouble with a checkbox, in my form I have &#60;input&#160;value=”Yes”&#160;/&gt;
Which means whenever it's checked the value is set to Yes, and this works perfectly with my server side validation and php's "isset" function,

However, whenever I pass the .val() of that checkbox via jQuery's AJAX, the value is ALWAYS "True", how can i fix this?</description>
		<content:encoded><![CDATA[<p>Trevor:</p>
<p>I am having trouble with a checkbox, in my form I have &lt;input&nbsp;value=”Yes”&nbsp;/><br />
Which means whenever it&#8217;s checked the value is set to Yes, and this works perfectly with my server side validation and php&#8217;s &#8220;isset&#8221; function,</p>
<p>However, whenever I pass the .val() of that checkbox via jQuery&#8217;s AJAX, the value is ALWAYS &#8220;True&#8221;, how can i fix this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 50 Excellent AJAX Tutorials &#124; Evolution : weblog</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1799</link>
		<dc:creator>50 Excellent AJAX Tutorials &#124; Evolution : weblog</dc:creator>
		<pubDate>Fri, 31 Oct 2008 04:24:29 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1799</guid>
		<description>[...] AJAX Forms with jQuery Trevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn’t right or complete. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] AJAX Forms with jQuery Trevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn’t right or complete. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Подборка AJAX скриптов &#124; Екатеринбургский ПЕШЕХОД</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1790</link>
		<dc:creator>Подборка AJAX скриптов &#124; Екатеринбургский ПЕШЕХОД</dc:creator>
		<pubDate>Tue, 28 Oct 2008 11:16:35 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1790</guid>
		<description>[...] AJAX Forms with jQuery [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] AJAX Forms with jQuery [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 16+ Ücretsiz Ajax İletişim Formu &#124; Batuhan Bulak</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1789</link>
		<dc:creator>16+ Ücretsiz Ajax İletişim Formu &#124; Batuhan Bulak</dc:creator>
		<pubDate>Sun, 26 Oct 2008 15:03:20 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1789</guid>
		<description>[...] jQuery Contact Form &#124; Demo [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] jQuery Contact Form | Demo [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blog Me I&#8217;m famous &#187; 16 exemples et sources de formulaires Ajax</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1786</link>
		<dc:creator>Blog Me I&#8217;m famous &#187; 16 exemples et sources de formulaires Ajax</dc:creator>
		<pubDate>Sat, 25 Oct 2008 14:27:58 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1786</guid>
		<description>[...] jQuery Contact Form - Demo [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] jQuery Contact Form - Demo [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Edwards</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1784</link>
		<dc:creator>Martin Edwards</dc:creator>
		<pubDate>Thu, 23 Oct 2008 10:50:01 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1784</guid>
		<description>Hi Trevor,

Thanks for putting this together, it's helped me out loads. I love JQuery, but had never used it in conjunction with AJAX.

I made a small tweak to the PHP, to help with validation:
if (mail($mailTo, $subject, $message, $headers)) {
	echo "Success";
}

This passes it back to the JS as the 'data' variable, then I could give a bit more feedback:
function(data){
	if (data == "Success") {
		alert('success message here');
	} else {
		alert('failure message here');
	}
}</description>
		<content:encoded><![CDATA[<p>Hi Trevor,</p>
<p>Thanks for putting this together, it&#8217;s helped me out loads. I love JQuery, but had never used it in conjunction with AJAX.</p>
<p>I made a small tweak to the PHP, to help with validation:<br />
if (mail($mailTo, $subject, $message, $headers)) {<br />
	echo &#8220;Success&#8221;;<br />
}</p>
<p>This passes it back to the JS as the &#8216;data&#8217; variable, then I could give a bit more feedback:<br />
function(data){<br />
	if (data == &#8220;Success&#8221;) {<br />
		alert(&#8216;success message here&#8217;);<br />
	} else {<br />
		alert(&#8216;failure message here&#8217;);<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Melhores tutoriais para desenvolvimento com AJAX - parte 1 &#124; Tuister</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1783</link>
		<dc:creator>Melhores tutoriais para desenvolvimento com AJAX - parte 1 &#124; Tuister</dc:creator>
		<pubDate>Wed, 22 Oct 2008 12:16:18 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1783</guid>
		<description>[...] Formulários AJAX com jQuery [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Formulários AJAX com jQuery [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduardo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1782</link>
		<dc:creator>Eduardo</dc:creator>
		<pubDate>Tue, 21 Oct 2008 20:03:32 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1782</guid>
		<description>h2mk:
Good point, but wouldn't the server side regEx validation for email address be enough to be safe?</description>
		<content:encoded><![CDATA[<p>h2mk:<br />
Good point, but wouldn&#8217;t the server side regEx validation for email address be enough to be safe?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 50+ Great Ajax Tutorial &#124; Tech User, Blogger and Designers References</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1780</link>
		<dc:creator>50+ Great Ajax Tutorial &#124; Tech User, Blogger and Designers References</dc:creator>
		<pubDate>Tue, 21 Oct 2008 11:34:20 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1780</guid>
		<description>[...] AJAX Forms with jQuery Trevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn’t right or complete. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] AJAX Forms with jQuery Trevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn’t right or complete. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hm2k</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1779</link>
		<dc:creator>hm2k</dc:creator>
		<pubDate>Tue, 21 Oct 2008 01:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1779</guid>
		<description>Beware of email injection with php's mail() function, google it.</description>
		<content:encoded><![CDATA[<p>Beware of email injection with php&#8217;s mail() function, google it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 50 Excellent AJAX Tutorials &#124; Web Burning Blog</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1777</link>
		<dc:creator>50 Excellent AJAX Tutorials &#124; Web Burning Blog</dc:creator>
		<pubDate>Sat, 18 Oct 2008 08:05:40 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1777</guid>
		<description>[...] AJAX Forms with jQueryTrevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn&#8217;t right or complete. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] AJAX Forms with jQueryTrevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn&#8217;t right or complete. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 50 Excellent AJAX Tutorials &#124; POLPDESIGN</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1776</link>
		<dc:creator>50 Excellent AJAX Tutorials &#124; POLPDESIGN</dc:creator>
		<pubDate>Sat, 18 Oct 2008 07:13:12 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1776</guid>
		<description>[...] AJAX Forms with jQuery Trevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn’t right or complete. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] AJAX Forms with jQuery Trevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn’t right or complete. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amir</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1775</link>
		<dc:creator>amir</dc:creator>
		<pubDate>Fri, 17 Oct 2008 20:12:39 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1775</guid>
		<description>thanks</description>
		<content:encoded><![CDATA[<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Useful AJAX Tutorials &#124; Neurosoftware web dev</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1773</link>
		<dc:creator>Useful AJAX Tutorials &#124; Neurosoftware web dev</dc:creator>
		<pubDate>Fri, 17 Oct 2008 06:58:29 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1773</guid>
		<description>[...] AJAX Forms with jQuery Trevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn’t right or complete. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] AJAX Forms with jQuery Trevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn’t right or complete. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 50 Excellent AJAX Tutorials &#124; Tutorials &#124; Smashing Magazine</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1765</link>
		<dc:creator>50 Excellent AJAX Tutorials &#124; Tutorials &#124; Smashing Magazine</dc:creator>
		<pubDate>Thu, 16 Oct 2008 21:46:06 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1765</guid>
		<description>[...] AJAX Forms with jQuery  Trevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn&#8217;t right or complete. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] AJAX Forms with jQuery  Trevor Davis shows how to create a form that will check an email address for validity, makes sure there are no blank fields and display an error if something isn&#8217;t right or complete. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1759</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 15 Oct 2008 23:29:06 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1759</guid>
		<description>@Eduardo-
Nice, I was going to suggest something was up with the config. Glad you got it working.</description>
		<content:encoded><![CDATA[<p>@Eduardo-<br />
Nice, I was going to suggest something was up with the config. Glad you got it working.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduardo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1758</link>
		<dc:creator>Eduardo</dc:creator>
		<pubDate>Wed, 15 Oct 2008 23:09:24 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1758</guid>
		<description>Ok I figured it out, my CMS had a .htaccess file that was blocking the script in the folder I was trying to access!. 
Thanks again!</description>
		<content:encoded><![CDATA[<p>Ok I figured it out, my CMS had a .htaccess file that was blocking the script in the folder I was trying to access!.<br />
Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduardo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1757</link>
		<dc:creator>Eduardo</dc:creator>
		<pubDate>Wed, 15 Oct 2008 17:04:20 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1757</guid>
		<description>Hi Trevor, yes the URL is correct and it does work without Javascript, I am using a CMS could that be the problem? but I load my form via an include  and it loads it fine and  as I said it gets sent without JS.</description>
		<content:encoded><![CDATA[<p>Hi Trevor, yes the URL is correct and it does work without Javascript, I am using a CMS could that be the problem? but I load my form via an include  and it loads it fine and  as I said it gets sent without JS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1756</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 15 Oct 2008 14:22:43 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1756</guid>
		<description>@Eduardo-
Are you sure you have the POST request submitting to the correct URL? So you said it works without JavaScript?</description>
		<content:encoded><![CDATA[<p>@Eduardo-<br />
Are you sure you have the POST request submitting to the correct URL? So you said it works without JavaScript?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduardo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1755</link>
		<dc:creator>Eduardo</dc:creator>
		<pubDate>Wed, 15 Oct 2008 07:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1755</guid>
		<description>Thanks Trevor I noticed it does work, for some reason when I can get your script to work on a sandbox site but on the one I actually want it to work, when the sendemail.php script is called by $.post I get a 
403 forbidden error, but the server validation does 
work, and it does send the email, do you know how I can get past this?</description>
		<content:encoded><![CDATA[<p>Thanks Trevor I noticed it does work, for some reason when I can get your script to work on a sandbox site but on the one I actually want it to work, when the sendemail.php script is called by $.post I get a<br />
403 forbidden error, but the server validation does<br />
work, and it does send the email, do you know how I can get past this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1752</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Tue, 14 Oct 2008 13:23:42 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1752</guid>
		<description>@Eduardo-
No, it does submit the form via an AJAX request.</description>
		<content:encoded><![CDATA[<p>@Eduardo-<br />
No, it does submit the form via an AJAX request.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduardo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1751</link>
		<dc:creator>Eduardo</dc:creator>
		<pubDate>Tue, 14 Oct 2008 03:15:09 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1751</guid>
		<description>Never mind my previous post, I attached jquery.js and your submitform.js files and it works like a charm.

From what I understand your script only does form validation, but not form submission using Ajax, am I correct?</description>
		<content:encoded><![CDATA[<p>Never mind my previous post, I attached jquery.js and your submitform.js files and it works like a charm.</p>
<p>From what I understand your script only does form validation, but not form submission using Ajax, am I correct?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduardo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1750</link>
		<dc:creator>Eduardo</dc:creator>
		<pubDate>Tue, 14 Oct 2008 03:02:10 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1750</guid>
		<description>Hi Trevor,

Thanks for the excellent tutorial, I have just started to use jQuery a couple of days ago.

I have downloaded the PHP files but I don't see where the jquery code is being loaded? I see that the error messages are output when something is not filled out, but I believe it's all the PHP errors generated by index.php. How can I know the form is being sent via ajax?</description>
		<content:encoded><![CDATA[<p>Hi Trevor,</p>
<p>Thanks for the excellent tutorial, I have just started to use jQuery a couple of days ago.</p>
<p>I have downloaded the PHP files but I don&#8217;t see where the jquery code is being loaded? I see that the error messages are output when something is not filled out, but I believe it&#8217;s all the PHP errors generated by index.php. How can I know the form is being sent via ajax?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1749</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 13 Oct 2008 16:03:30 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1749</guid>
		<description>I've found a solution Trevor. Thank you.
In sendemail.php I've changed:

$message = stripslashes (utf8_decode ($_POST['message']));

It's not very "artistic", but it works ! ;-)</description>
		<content:encoded><![CDATA[<p>I&#8217;ve found a solution Trevor. Thank you.<br />
In sendemail.php I&#8217;ve changed:</p>
<p>$message = stripslashes (utf8_decode ($_POST[&#8216;message&#8217;]));</p>
<p>It&#8217;s not very &#8220;artistic&#8221;, but it works ! ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1748</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Mon, 13 Oct 2008 15:51:08 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1748</guid>
		<description>@Joe-
You could change the email to be an html email instead of just text. Then use the &lt;a href="http://us3.php.net/manual/en/function.htmlentities.php" rel="nofollow"&gt;htmlentities function&lt;/a&gt; to convert all characters to the appropriate entities.</description>
		<content:encoded><![CDATA[<p>@Joe-<br />
You could change the email to be an html email instead of just text. Then use the <a href="http://us3.php.net/manual/en/function.htmlentities.php" rel="nofollow">htmlentities function</a> to convert all characters to the appropriate entities.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1747</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 13 Oct 2008 14:03:47 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1747</guid>
		<description>Thank you Trevor ! Another question: I'm french and unfortunately we have some accents in our alphabet...
When I receive a mail including accented letters, I have some strange characters like "Ã©" instead of "é" for example. 
Is there a coding solution to avoid this problem ?</description>
		<content:encoded><![CDATA[<p>Thank you Trevor ! Another question: I&#8217;m french and unfortunately we have some accents in our alphabet&#8230;<br />
When I receive a mail including accented letters, I have some strange characters like &#8220;Ã©&#8221; instead of &#8220;é&#8221; for example.<br />
Is there a coding solution to avoid this problem ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1743</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Thu, 09 Oct 2008 04:10:45 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1743</guid>
		<description>@Clemente G-
Do you have a link I can take a look at?</description>
		<content:encoded><![CDATA[<p>@Clemente G-<br />
Do you have a link I can take a look at?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clemente G</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1742</link>
		<dc:creator>Clemente G</dc:creator>
		<pubDate>Thu, 09 Oct 2008 04:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1742</guid>
		<description>How can you use this to work with wordpress? I have the contact working it sends the email. I have contact.php embedded into a div on my main page. The problem is it reloads the whole page and the posts do not show.

Any suggestions??</description>
		<content:encoded><![CDATA[<p>How can you use this to work with wordpress? I have the contact working it sends the email. I have contact.php embedded into a div on my main page. The problem is it reloads the whole page and the posts do not show.</p>
<p>Any suggestions??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2008-10-08 &#124; 甘先生blog</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1741</link>
		<dc:creator>links for 2008-10-08 &#124; 甘先生blog</dc:creator>
		<pubDate>Wed, 08 Oct 2008 08:05:42 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1741</guid>
		<description>[...] Ajax Forms with jQuery &#124; Trevor Davis (tags: ajax:form) [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Ajax Forms with jQuery | Trevor Davis (tags: ajax:form) [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1738</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Mon, 06 Oct 2008 13:13:01 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1738</guid>
		<description>@Joe-
You will need to modify the sendEmail.php file and add in your new fields to the email.</description>
		<content:encoded><![CDATA[<p>@Joe-<br />
You will need to modify the sendEmail.php file and add in your new fields to the email.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1736</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 06 Oct 2008 06:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1736</guid>
		<description>Hi Trevor,

Thanks for this great tutorial. A question: I would like to add a "Your name" field, si I would have "Your name"+"Your email address"+"Subject" and the message. 

I tried to do this, no problems to add this additionnal field, to verify it etc... but in the mail I don't receive the name of the sender...
Is it possible ? Please could you help me ?
(Sorry for the bad english)</description>
		<content:encoded><![CDATA[<p>Hi Trevor,</p>
<p>Thanks for this great tutorial. A question: I would like to add a &#8220;Your name&#8221; field, si I would have &#8220;Your name&#8221;+&#8221;Your email address&#8221;+&#8221;Subject&#8221; and the message. </p>
<p>I tried to do this, no problems to add this additionnal field, to verify it etc&#8230; but in the mail I don&#8217;t receive the name of the sender&#8230;<br />
Is it possible ? Please could you help me ?<br />
(Sorry for the bad english)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake Rutter</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1716</link>
		<dc:creator>Jake Rutter</dc:creator>
		<pubDate>Tue, 30 Sep 2008 20:32:31 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1716</guid>
		<description>Great Tutorial! Thanks!</description>
		<content:encoded><![CDATA[<p>Great Tutorial! Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1713</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Mon, 29 Sep 2008 19:56:25 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1713</guid>
		<description>@Federico-
In the PHP file you are calling via the POST request, you can just &lt;strong&gt;echo&lt;/strong&gt; something out. Whatever you &lt;strong&gt;echo&lt;/strong&gt; out, will be available in the data variable:
&lt;pre&gt;&lt;code&gt;$.post("/play/jqueryAjaxForm/sendEmail.php",
   { emailTo: emailToVal, emailFrom: emailFromVal, subject: subjectVal, message: messageVal },
   	&lt;strong&gt;function(data){&lt;/strong&gt;

	}
);&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Federico-<br />
In the PHP file you are calling via the POST request, you can just <strong>echo</strong> something out. Whatever you <strong>echo</strong> out, will be available in the data variable:</p>
<pre><code>$.post("/play/jqueryAjaxForm/sendEmail.php",
   { emailTo: emailToVal, emailFrom: emailFromVal, subject: subjectVal, message: messageVal },
   	<strong>function(data){</strong>

	}
);</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Federico</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1705</link>
		<dc:creator>Federico</dc:creator>
		<pubDate>Sun, 28 Sep 2008 07:16:11 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1705</guid>
		<description>Thx for reply Trevor.
About the code snippet, the question is: how do I get and print some text returning from the PHP server file?
I know that I have to add an id "message" in the web page but I don't understand how can I pass some text from the php to a $("#message").text variable instead a fixed text.
Hope I explained..sorry for bad english!</description>
		<content:encoded><![CDATA[<p>Thx for reply Trevor.<br />
About the code snippet, the question is: how do I get and print some text returning from the PHP server file?<br />
I know that I have to add an id &#8220;message&#8221; in the web page but I don&#8217;t understand how can I pass some text from the php to a $(&#8220;#message&#8221;).text variable instead a fixed text.<br />
Hope I explained..sorry for bad english!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1704</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Sun, 28 Sep 2008 02:00:39 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1704</guid>
		<description>@Federico-
Sure, you could make the contact form more secure, but if you are just using it to send an email and not interacting with a database, it may be a lot of extra effort for not much benefit.

Regarding the code snippet you included, you just need to have an element with the id of &lt;strong&gt;message&lt;/strong&gt;, and the text will be changed depending upon the condition. Does that answer your question?</description>
		<content:encoded><![CDATA[<p>@Federico-<br />
Sure, you could make the contact form more secure, but if you are just using it to send an email and not interacting with a database, it may be a lot of extra effort for not much benefit.</p>
<p>Regarding the code snippet you included, you just need to have an element with the id of <strong>message</strong>, and the text will be changed depending upon the condition. Does that answer your question?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Federico</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1703</link>
		<dc:creator>Federico</dc:creator>
		<pubDate>Sat, 27 Sep 2008 08:54:50 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1703</guid>
		<description>Great script trevor, thanks for your effort.
Just a couple of questions:
how to modify the senEmail.php code to improve security? Maybe using somke trick like the following one: http://15daysofjquery.com/examples/contact-forms/

About the php feedback code, like this one:
if(data){
$(“#message”).text(‘Your request was sent.’);
} else {
$(“#message”).text(‘An error occurred. Your request could not be sent.’);

I don't understand exactly how I could show in the contact form page how to display a message sent by the sendemail.php file if in it I use some echo message.

Thanks a lot for reply</description>
		<content:encoded><![CDATA[<p>Great script trevor, thanks for your effort.<br />
Just a couple of questions:<br />
how to modify the senEmail.php code to improve security? Maybe using somke trick like the following one: <a href="http://15daysofjquery.com/examples/contact-forms/" rel="nofollow">http://15daysofjquery.com/examples/contact-forms/</a></p>
<p>About the php feedback code, like this one:<br />
if(data){<br />
$(“#message”).text(‘Your request was sent.’);<br />
} else {<br />
$(“#message”).text(‘An error occurred. Your request could not be sent.’);</p>
<p>I don&#8217;t understand exactly how I could show in the contact form page how to display a message sent by the sendemail.php file if in it I use some echo message.</p>
<p>Thanks a lot for reply</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Brookes</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1688</link>
		<dc:creator>Dave Brookes</dc:creator>
		<pubDate>Thu, 25 Sep 2008 21:29:12 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1688</guid>
		<description>@ Kerwin Groot

Hi Kerwin,

Using your ziped example emails don't seem to get sent when JavaScript is disabled, can you confirm that you are defiantly receiving emails from none JavaScript clients?

Thanks,

Dave</description>
		<content:encoded><![CDATA[<p>@ Kerwin Groot</p>
<p>Hi Kerwin,</p>
<p>Using your ziped example emails don&#8217;t seem to get sent when JavaScript is disabled, can you confirm that you are defiantly receiving emails from none JavaScript clients?</p>
<p>Thanks,</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rafa Garcia</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1638</link>
		<dc:creator>Rafa Garcia</dc:creator>
		<pubDate>Fri, 12 Sep 2008 11:08:11 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1638</guid>
		<description>Simple as good things are.</description>
		<content:encoded><![CDATA[<p>Simple as good things are.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kerwin Groot</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1632</link>
		<dc:creator>Kerwin Groot</dc:creator>
		<pubDate>Thu, 11 Sep 2008 10:15:59 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1632</guid>
		<description>I've had some poking out on this thing aswell so maybe i can help a bunch of you guys out by sharing my packed version of the form.

It's has got the "Email To" field removed, because all mail in my contact form should go to me.

The only setup it needs is to replace the dummy adres with your own in "sendemail.php" at the bottom.

And optionaly: if you change the directory name (by default "contactForm" you should change the form action parameter located in index.php accordingly.

Thkx Trevor for making this form, saved me a lot of time!

The file: www.kerwin-groot.nl/upload/contactForm.zip</description>
		<content:encoded><![CDATA[<p>I&#8217;ve had some poking out on this thing aswell so maybe i can help a bunch of you guys out by sharing my packed version of the form.</p>
<p>It&#8217;s has got the &#8220;Email To&#8221; field removed, because all mail in my contact form should go to me.</p>
<p>The only setup it needs is to replace the dummy adres with your own in &#8220;sendemail.php&#8221; at the bottom.</p>
<p>And optionaly: if you change the directory name (by default &#8220;contactForm&#8221; you should change the form action parameter located in index.php accordingly.</p>
<p>Thkx Trevor for making this form, saved me a lot of time!</p>
<p>The file: <a href="http://www.kerwin-groot.nl/upload/contactForm.zip" rel="nofollow">http://www.kerwin-groot.nl/upload/contactForm.zip</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 2008 September 11 - Links for today &#171; My (almost) Daily Links</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1629</link>
		<dc:creator>2008 September 11 - Links for today &#171; My (almost) Daily Links</dc:creator>
		<pubDate>Thu, 11 Sep 2008 05:01:06 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1629</guid>
		<description>[...] jQuery with Dynamic Data Customizing the Delete Confirmation Dialog Trevor Davis gives us a take on AJAX Forms with jQuery James Padolsy brings us his 10 useful jQuery plugins Dossy Shiobara brings us Client-side query [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] jQuery with Dynamic Data Customizing the Delete Confirmation Dialog Trevor Davis gives us a take on AJAX Forms with jQuery James Padolsy brings us his 10 useful jQuery plugins Dossy Shiobara brings us Client-side query [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RSSA聚合 &#187; 25 Awesome tutorials for web designers</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1617</link>
		<dc:creator>RSSA聚合 &#187; 25 Awesome tutorials for web designers</dc:creator>
		<pubDate>Tue, 09 Sep 2008 09:44:26 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1617</guid>
		<description>[...] 11. Ajax Forms with jQuery Travor Davis illustrates how easy it is to turn a regular form into a AJAX form. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] 11. Ajax Forms with jQuery Travor Davis illustrates how easy it is to turn a regular form into a AJAX form. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 25 Awesome tutorials for web designers &#124; 打篮球的手</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1614</link>
		<dc:creator>25 Awesome tutorials for web designers &#124; 打篮球的手</dc:creator>
		<pubDate>Mon, 08 Sep 2008 10:26:59 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1614</guid>
		<description>[...] 11. Ajax Forms with jQuery Travor Davis illustrates how easy it is to turn a regular form into a AJAX form. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] 11. Ajax Forms with jQuery Travor Davis illustrates how easy it is to turn a regular form into a AJAX form. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1553</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Sep 2008 04:39:36 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1553</guid>
		<description>Does your server have a mail server specified? 
Maybe. I tried to set up gmail apps, as well as emails for my domain, but ran into some snags. There's a step that requires me to change my cName record, something i have to put a ticket in to do. I keep putting in ticket requests, but mail.creativehinge.com just doesn't seem to be working. Anyhoo, thats another ish.

Thanks for all your help!</description>
		<content:encoded><![CDATA[<p>Does your server have a mail server specified?<br />
Maybe. I tried to set up gmail apps, as well as emails for my domain, but ran into some snags. There&#8217;s a step that requires me to change my cName record, something i have to put a ticket in to do. I keep putting in ticket requests, but mail.creativehinge.com just doesn&#8217;t seem to be working. Anyhoo, thats another ish.</p>
<p>Thanks for all your help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1552</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 03 Sep 2008 04:25:47 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1552</guid>
		<description>Chris-
I'm not sure what to suggest at this point. Since you get all the way to the thank you message, there is no error in the code. Does your server have a mail server specified? Is it going to your spam folder in gmail? Are you sure you have your email address correct?</description>
		<content:encoded><![CDATA[<p>Chris-<br />
I&#8217;m not sure what to suggest at this point. Since you get all the way to the thank you message, there is no error in the code. Does your server have a mail server specified? Is it going to your spam folder in gmail? Are you sure you have your email address correct?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1551</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Sep 2008 04:14:52 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1551</guid>
		<description>Hey Trevor. I removed that line of code from verify. I also changed my email address to my gmail just to make sure, but am still not receiving emails. It pulls up the success info, but i just dont get an email. I assume the link in verify to sendemail.php works as it pulls in thanks.php...any ideas?</description>
		<content:encoded><![CDATA[<p>Hey Trevor. I removed that line of code from verify. I also changed my email address to my gmail just to make sure, but am still not receiving emails. It pulls up the success info, but i just dont get an email. I assume the link in verify to sendemail.php works as it pulls in thanks.php&#8230;any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1550</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 03 Sep 2008 04:08:55 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1550</guid>
		<description>Chris-
Yep, that should still work. I would remove this line since you removed the &lt;strong&gt;emailTo&lt;/strong&gt; field:

&lt;pre&gt;&lt;code&gt;$mailTo = $_POST[‘emailTo’];&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Chris-<br />
Yep, that should still work. I would remove this line since you removed the <strong>emailTo</strong> field:</p>
<pre><code>$mailTo = $_POST[‘emailTo’];</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1549</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Sep 2008 04:04:31 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1549</guid>
		<description>Excellent! I get the success message! This is all very good, what wonderful code.  Just a couple more questions, as i dont seem to be actually getting the emails though it might be my webapp. just wanted to make sure the code is functional. 

here is the code from sendemail.php:

$mailTo = $_POST['emailTo'];
$mailFrom = $_POST['emailFrom'];
$subject = $_POST['subject'];
$message = $_POST['message'];

			
mail('christopher.homan@gmail.com', $subject, $message, "From: ".$mailFrom);


Is this right?</description>
		<content:encoded><![CDATA[<p>Excellent! I get the success message! This is all very good, what wonderful code.  Just a couple more questions, as i dont seem to be actually getting the emails though it might be my webapp. just wanted to make sure the code is functional. </p>
<p>here is the code from sendemail.php:</p>
<p>$mailTo = $_POST[&#8216;emailTo&#8217;];<br />
$mailFrom = $_POST[&#8216;emailFrom&#8217;];<br />
$subject = $_POST[&#8216;subject&#8217;];<br />
$message = $_POST[&#8216;message&#8217;];</p>
<p>mail(&#8216;christopher.homan@gmail.com&#8217;, $subject, $message, &#8220;From: &#8220;.$mailFrom);</p>
<p>Is this right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1548</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Sep 2008 03:50:58 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1548</guid>
		<description>I think my main issue is with my verify code:

(this is wrapped in a php tag)

if(isset($_POST['submitted'])) {
	if($_POST['emailTo'] == '') {
		$emailToError = '*Oops. We dont know your email.';
	} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", $_POST['emailTo'])) {
		$emailToError = 'Enter a valid email address to send to.';
	}
	if($_POST['emailFrom'] == '') {
		$emailFromError = '*Oops. We dont know where to send it.';
	} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", $_POST['emailFrom'])) {
		$emailFromError = 'Enter a valid email address to send from.';
	}
	
	if($_POST['subject'] == '') {
		$subjectError = 'You forgot to enter the subject.';
	}
	
	if($_POST['message'] == '') {
		$messageError = 'You forgot to enter the message.';
	}

	if(!isset($emailToError) &#38;&#38; !isset($emailFromError) &#38;&#38; !isset($subjectError) &#38;&#38; !isset($messageError)) {
		include('form/sendEmail.php');
		include('form/thanks.php');
	}
}</description>
		<content:encoded><![CDATA[<p>I think my main issue is with my verify code:</p>
<p>(this is wrapped in a php tag)</p>
<p>if(isset($_POST[&#8216;submitted&#8217;])) {<br />
	if($_POST[&#8216;emailTo&#8217;] == &#8221;) {<br />
		$emailToError = &#8216;*Oops. We dont know your email.&#8217;;<br />
	} else if (!eregi(&#8220;^[A-Z0-9._%-]+@[A-Z0-9._%-]+&#46;[A-Z]{2,4}$&#8221;, $_POST[&#8216;emailTo&#8217;])) {<br />
		$emailToError = &#8216;Enter a valid email address to send to.&#8217;;<br />
	}<br />
	if($_POST[&#8216;emailFrom&#8217;] == &#8221;) {<br />
		$emailFromError = &#8216;*Oops. We dont know where to send it.&#8217;;<br />
	} else if (!eregi(&#8220;^[A-Z0-9._%-]+@[A-Z0-9._%-]+&#46;[A-Z]{2,4}$&#8221;, $_POST[&#8216;emailFrom&#8217;])) {<br />
		$emailFromError = &#8216;Enter a valid email address to send from.&#8217;;<br />
	}</p>
<p>	if($_POST[&#8216;subject&#8217;] == &#8221;) {<br />
		$subjectError = &#8216;You forgot to enter the subject.&#8217;;<br />
	}</p>
<p>	if($_POST[&#8216;message&#8217;] == &#8221;) {<br />
		$messageError = &#8216;You forgot to enter the message.&#8217;;<br />
	}</p>
<p>	if(!isset($emailToError) &amp;&amp; !isset($emailFromError) &amp;&amp; !isset($subjectError) &amp;&amp; !isset($messageError)) {<br />
		include(&#8216;form/sendEmail.php&#8217;);<br />
		include(&#8216;form/thanks.php&#8217;);<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1547</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 03 Sep 2008 03:50:15 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1547</guid>
		<description>@Chris-
Yes, just remove all of this from verify.php:

&lt;pre&gt;&lt;code&gt;if($_POST['emailTo'] == '') {
	$emailToError = 'You forgot to enter the email address to send to.';
} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", $_POST['emailTo'])) {
	$emailToError = 'Enter a valid email address to send to.';
}&lt;/code&gt;&lt;/pre&gt;

Then, change line 22 of verify.php to be:

&lt;pre&gt;&lt;code&gt;if(!isset($emailFromError) &#038;&#038; !isset($subjectError) &#038;&#038; !isset($messageError)) {&lt;/code&gt;&lt;/pre&gt;

That should do it.</description>
		<content:encoded><![CDATA[<p>@Chris-<br />
Yes, just remove all of this from verify.php:</p>
<pre><code>if($_POST['emailTo'] == '') {
	$emailToError = 'You forgot to enter the email address to send to.';
} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", $_POST['emailTo'])) {
	$emailToError = 'Enter a valid email address to send to.';
}</code></pre>
<p>Then, change line 22 of verify.php to be:</p>
<pre><code>if(!isset($emailFromError) &#038;& !isset($subjectError) &#038;& !isset($messageError)) {</code></pre>
<p>That should do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1546</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Sep 2008 03:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1546</guid>
		<description>I've never gotten forum/blog advice before, so i appreciate all the quick replies! Just tried to place a chunk of code in there, and it seemed to eat it up. Whats the trick you use to get code up here?

Also, what can i send you to help you get a better idea?

thanks</description>
		<content:encoded><![CDATA[<p>I&#8217;ve never gotten forum/blog advice before, so i appreciate all the quick replies! Just tried to place a chunk of code in there, and it seemed to eat it up. Whats the trick you use to get code up here?</p>
<p>Also, what can i send you to help you get a better idea?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1545</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Sep 2008 03:44:59 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1545</guid>
		<description>here's all my verify code:

</description>
		<content:encoded><![CDATA[<p>here&#8217;s all my verify code:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1544</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Sep 2008 03:43:24 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1544</guid>
		<description>no i never removed code from verify, just the frontward facing entry box. should i delete that whole first chunk:

if($_POST['emailTo'] == '') {
		$emailToError = '*Oops. We dont know your email.';
	} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", $_POST['emailTo'])) {
		$emailToError = 'Enter a valid email address to send to.';
	}

Thanks</description>
		<content:encoded><![CDATA[<p>no i never removed code from verify, just the frontward facing entry box. should i delete that whole first chunk:</p>
<p>if($_POST[&#8216;emailTo&#8217;] == &#8221;) {<br />
		$emailToError = &#8216;*Oops. We dont know your email.&#8217;;<br />
	} else if (!eregi(&#8220;^[A-Z0-9._%-]+@[A-Z0-9._%-]+&#46;[A-Z]{2,4}$&#8221;, $_POST[&#8216;emailTo&#8217;])) {<br />
		$emailToError = &#8216;Enter a valid email address to send to.&#8217;;<br />
	}</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1543</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 03 Sep 2008 03:40:17 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1543</guid>
		<description>@Chris-
It's hard to debug it without looking at the PHP. Did you remove all traces of &lt;strong&gt;emailTo&lt;/strong&gt; in verify.php? It looks like you never get to the success state.</description>
		<content:encoded><![CDATA[<p>@Chris-<br />
It&#8217;s hard to debug it without looking at the PHP. Did you remove all traces of <strong>emailTo</strong> in verify.php? It looks like you never get to the success state.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1542</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Sep 2008 03:17:35 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1542</guid>
		<description>Hey there,

It doesn't seem to be sending the emails when i click submit, nor does it pull in the thanks.php info. I know it's something really silly i'm not doing on my part....could you take a look? I hate to be a pain.

Here's the link again:
http://dev.creativehinge.com/contact.php
the other files are in this directory:
http://dev.creativehinge.com/form/

Again, Thanks so much.

Chris</description>
		<content:encoded><![CDATA[<p>Hey there,</p>
<p>It doesn&#8217;t seem to be sending the emails when i click submit, nor does it pull in the thanks.php info. I know it&#8217;s something really silly i&#8217;m not doing on my part&#8230;.could you take a look? I hate to be a pain.</p>
<p>Here&#8217;s the link again:<br />
<a href="http://dev.creativehinge.com/contact.php" rel="nofollow">http://dev.creativehinge.com/contact.php</a><br />
the other files are in this directory:<br />
<a href="http://dev.creativehinge.com/form/" rel="nofollow">http://dev.creativehinge.com/form/</a></p>
<p>Again, Thanks so much.</p>
<p>Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1539</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 03 Sep 2008 02:01:05 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1539</guid>
		<description>@Chris-
You basically want to take all of the coding from index.php and put it in contact.php. Then reference the other PHP files appropriately. So you would change the form action to be &lt;strong&gt;contact.php&lt;/strong&gt; now.</description>
		<content:encoded><![CDATA[<p>@Chris-<br />
You basically want to take all of the coding from index.php and put it in contact.php. Then reference the other PHP files appropriately. So you would change the form action to be <strong>contact.php</strong> now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1538</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Sep 2008 00:59:26 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1538</guid>
		<description>Hey, thanks so much for that line of code. I've made the two changes, but i'm still unsure of a couple of things. I'm embedding the form in my contact page here:
http://dev.creativehinge.com/contact.php

So technically i wouldn't even need the index.php page in the forms/ directory. Can i remove this file from the folder?

Then, on my contact page, Change the form action to point to itself. So change it from /play/jqueryAjaxForm/ to /form/?

Also, is the "/" necessary before the folder "form"?

Thanks SOO much...</description>
		<content:encoded><![CDATA[<p>Hey, thanks so much for that line of code. I&#8217;ve made the two changes, but i&#8217;m still unsure of a couple of things. I&#8217;m embedding the form in my contact page here:<br />
<a href="http://dev.creativehinge.com/contact.php" rel="nofollow">http://dev.creativehinge.com/contact.php</a></p>
<p>So technically i wouldn&#8217;t even need the index.php page in the forms/ directory. Can i remove this file from the folder?</p>
<p>Then, on my contact page, Change the form action to point to itself. So change it from /play/jqueryAjaxForm/ to /form/?</p>
<p>Also, is the &#8220;/&#8221; necessary before the folder &#8220;form&#8221;?</p>
<p>Thanks SOO much&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1536</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 03 Sep 2008 00:22:19 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1536</guid>
		<description>@Chris-
Change the form action on &lt;a href="http://dev.creativehinge.com/form" rel="nofollow"&gt;this page&lt;/a&gt; to point to itself. So change it from /play/jqueryAjaxForm/ to /form/.

Remove all of the information regarding the &lt;strong&gt;emailTo&lt;/strong&gt; form element and update line 9 of sendEmail.php to read:

&lt;pre&gt;&lt;code&gt;mail('info@creativehinge.com', $subject, $message, "From: ".$mailFrom);&lt;/code&gt;&lt;/pre&gt;

Hope that helps.</description>
		<content:encoded><![CDATA[<p>@Chris-<br />
Change the form action on <a href="http://dev.creativehinge.com/form" rel="nofollow">this page</a> to point to itself. So change it from /play/jqueryAjaxForm/ to /form/.</p>
<p>Remove all of the information regarding the <strong>emailTo</strong> form element and update line 9 of sendEmail.php to read:</p>
<pre><code>mail('info@creativehinge.com', $subject, $message, "From: ".$mailFrom);</code></pre>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1534</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Tue, 02 Sep 2008 23:48:01 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1534</guid>
		<description>Hey there. Thanks so much for supplying this code for everyone to use. I am somewhat of a newbie to forms and suck, and was wondering if you could help me out. I have this code on my contact page here:
http://dev.creativehinge.com/contact.php

I also have the four files you supplied here:
http://dev.creativehinge.com/form

How do i get this started? I hit submit and it looks for the "/play/jqueryAjaxForm/" directory. What do I place in this form action acrea? I want to achive the following:

1.Remove the option of entering an email address. All emails should go to to info@creativehinge.com

Thanks for any help you can provide.</description>
		<content:encoded><![CDATA[<p>Hey there. Thanks so much for supplying this code for everyone to use. I am somewhat of a newbie to forms and suck, and was wondering if you could help me out. I have this code on my contact page here:<br />
<a href="http://dev.creativehinge.com/contact.php" rel="nofollow">http://dev.creativehinge.com/contact.php</a></p>
<p>I also have the four files you supplied here:<br />
<a href="http://dev.creativehinge.com/form" rel="nofollow">http://dev.creativehinge.com/form</a></p>
<p>How do i get this started? I hit submit and it looks for the &#8220;/play/jqueryAjaxForm/&#8221; directory. What do I place in this form action acrea? I want to achive the following:</p>
<p>1.Remove the option of entering an email address. All emails should go to to <a href="mailto:info@creativehinge.com">info@creativehinge.com</a></p>
<p>Thanks for any help you can provide.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christoph G.</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1522</link>
		<dc:creator>Christoph G.</dc:creator>
		<pubDate>Tue, 02 Sep 2008 12:38:13 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1522</guid>
		<description>Thanks a lot for sharing so good inputs!</description>
		<content:encoded><![CDATA[<p>Thanks a lot for sharing so good inputs!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1378</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Mon, 25 Aug 2008 12:50:58 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1378</guid>
		<description>&lt;p&gt;@Benjamin-&lt;br /&gt;
You would do it the same way you would any other input field.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$('#idOfSelectHere').val();&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Benjamin-<br />
You would do it the same way you would any other input field.</p>
<pre><code>$('#idOfSelectHere').val();</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: benjamin</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1377</link>
		<dc:creator>benjamin</dc:creator>
		<pubDate>Mon, 25 Aug 2008 09:23:52 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1377</guid>
		<description>hi trevor!
your site is just great. thanks a lot for sharing so good inputs. may i ask you, how you transmit the values of select-items with ajax-forms with jquery?
cheers!
greetings, benjamin</description>
		<content:encoded><![CDATA[<p>hi trevor!<br />
your site is just great. thanks a lot for sharing so good inputs. may i ask you, how you transmit the values of select-items with ajax-forms with jquery?<br />
cheers!<br />
greetings, benjamin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 25 Awesome tutorials for web designers &#124; Boxed CSS</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1253</link>
		<dc:creator>25 Awesome tutorials for web designers &#124; Boxed CSS</dc:creator>
		<pubDate>Sat, 16 Aug 2008 14:54:40 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1253</guid>
		<description>[...] 11. Ajax Forms with jQueryTravor Davis illustrates how easy it is to turn a regular form into a AJAX form. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] 11. Ajax Forms with jQueryTravor Davis illustrates how easy it is to turn a regular form into a AJAX form. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 25 Awesome tutorials for web designers &#124; Boxed CSS</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1254</link>
		<dc:creator>25 Awesome tutorials for web designers &#124; Boxed CSS</dc:creator>
		<pubDate>Sat, 16 Aug 2008 14:54:40 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1254</guid>
		<description>[...] 11. Ajax Forms with jQueryTravor Davis illustrates how easy it is to turn a regular form into a AJAX form. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] 11. Ajax Forms with jQueryTravor Davis illustrates how easy it is to turn a regular form into a AJAX form. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: From free for free &#187; Blog Archive &#187; 25 Awesome tutorials for web designers</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1220</link>
		<dc:creator>From free for free &#187; Blog Archive &#187; 25 Awesome tutorials for web designers</dc:creator>
		<pubDate>Tue, 12 Aug 2008 09:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1220</guid>
		<description>[...] 11. Ajax Forms with jQueryTravor Davis illustrates how easy it is to turn a regular form into a AJAX form. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] 11. Ajax Forms with jQueryTravor Davis illustrates how easy it is to turn a regular form into a AJAX form. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 25 Awesome tutorials for web designers &#171; Guiwells&#8217;s Blog</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1215</link>
		<dc:creator>25 Awesome tutorials for web designers &#171; Guiwells&#8217;s Blog</dc:creator>
		<pubDate>Tue, 12 Aug 2008 05:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1215</guid>
		<description>[...] 11. Ajax Forms with jQueryTravor Davis illustrates how easy it is to turn a regular form into a AJAX form. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] 11. Ajax Forms with jQueryTravor Davis illustrates how easy it is to turn a regular form into a AJAX form. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 25 Awesome tutorials for web designers &#171; Narendra Dhami</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1212</link>
		<dc:creator>25 Awesome tutorials for web designers &#171; Narendra Dhami</dc:creator>
		<pubDate>Tue, 12 Aug 2008 01:01:35 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1212</guid>
		<description>[...] 11. Ajax Forms with jQueryTravor Davis illustrates how easy it is to turn a regular form into a AJAX form. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] 11. Ajax Forms with jQueryTravor Davis illustrates how easy it is to turn a regular form into a AJAX form. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: josh</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1059</link>
		<dc:creator>josh</dc:creator>
		<pubDate>Sun, 03 Aug 2008 06:42:36 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1059</guid>
		<description>Trevor,

Can you help me out a bit. I am looking for a way to use a for loop in a similar situation you demo'd 
&lt;a href="http://trevordavis.net/play/jqueryajaxform/jquery-radio-buttons/" rel="nofollow"&gt;here:&lt;/a&gt;

But with the addition of more sets of radio buttons. I want to be able to have a function loop through the radio button sets and with a counting var keep track of how many are "checked". Once the loop has gone through the length of the array of li's or ? Another function then does something based on the counting var.

I can't seem to get the for loop to work and I am not sure how to get around identifying each radio as an id?

Does this make sense? 

If not email me and I will send you my code block.

Thanks for any help in advance if you have time I'd appreciate the learning exp:)</description>
		<content:encoded><![CDATA[<p>Trevor,</p>
<p>Can you help me out a bit. I am looking for a way to use a for loop in a similar situation you demo&#8217;d<br />
<a href="http://trevordavis.net/play/jqueryajaxform/jquery-radio-buttons/" rel="nofollow">here:</a></p>
<p>But with the addition of more sets of radio buttons. I want to be able to have a function loop through the radio button sets and with a counting var keep track of how many are &#8220;checked&#8221;. Once the loop has gone through the length of the array of li&#8217;s or ? Another function then does something based on the counting var.</p>
<p>I can&#8217;t seem to get the for loop to work and I am not sure how to get around identifying each radio as an id?</p>
<p>Does this make sense? </p>
<p>If not email me and I will send you my code block.</p>
<p>Thanks for any help in advance if you have time I&#8217;d appreciate the learning exp:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Devich &#187; Blog Archive &#187; Radio button control</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1017</link>
		<dc:creator>Devich &#187; Blog Archive &#187; Radio button control</dc:creator>
		<pubDate>Fri, 25 Jul 2008 02:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1017</guid>
		<description>[...] Ajax Forms with jQuery [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Ajax Forms with jQuery [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1011</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Sun, 20 Jul 2008 00:42:24 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1011</guid>
		<description>@James-
You can just remove that line from the code. It is just a file that contains my Google Analytics information. I guess I should have removed it from the source files.</description>
		<content:encoded><![CDATA[<p>@James-<br />
You can just remove that line from the code. It is just a file that contains my Google Analytics information. I guess I should have removed it from the source files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: james</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-1010</link>
		<dc:creator>james</dc:creator>
		<pubDate>Sat, 19 Jul 2008 22:52:47 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-1010</guid>
		<description>Hi,

I just came across your Ajax contact form tutorial. I'm having a little trouble. What is the "'../../includes/analytics.php'? Where is this particular file? Every time I try to send a message I get on the index page this "Warning: main(../../includes/analytics.php): failed to open stream: No such file or directory in /home/content/k/h/a/khariwilliams/html/beego/indexer.php on line 28

Warning: main(../../includes/analytics.php): failed to open stream: No such file or directory in /home/content/k/h/a/khariwilliams/html/beego/indexer.php on line 28

Warning: main(): Failed opening '../../includes/analytics.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/k/h/a/khariwilliams/html/beego/indexer.php on line 28"

Can u please help me! Or send e-mail the exact codes the way created your mail form.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I just came across your Ajax contact form tutorial. I&#8217;m having a little trouble. What is the &#8220;&#8217;../../includes/analytics.php&#8217;? Where is this particular file? Every time I try to send a message I get on the index page this &#8220;Warning: main(../../includes/analytics.php): failed to open stream: No such file or directory in /home/content/k/h/a/khariwilliams/html/beego/indexer.php on line 28</p>
<p>Warning: main(../../includes/analytics.php): failed to open stream: No such file or directory in /home/content/k/h/a/khariwilliams/html/beego/indexer.php on line 28</p>
<p>Warning: main(): Failed opening &#8216;../../includes/analytics.php&#8217; for inclusion (include_path=&#8217;.:/usr/local/lib/php&#8217;) in /home/content/k/h/a/khariwilliams/html/beego/indexer.php on line 28&#8221;</p>
<p>Can u please help me! Or send e-mail the exact codes the way created your mail form.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seb</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-991</link>
		<dc:creator>seb</dc:creator>
		<pubDate>Sun, 06 Jul 2008 22:50:20 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-991</guid>
		<description>cool</description>
		<content:encoded><![CDATA[<p>cool</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-980</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Tue, 01 Jul 2008 02:36:55 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-980</guid>
		<description>@Darrious-
I think that there are surely a bunch of different ways to achieve what you are trying to do. I made an &lt;a href="http://trevordavis.net/play/jqueryajaxform/jquery-radio-buttons/" rel="nofollow"&gt;example page&lt;/a&gt; showing this.

When you hit submit, it will tell you which radio button is selected.  Basically, I am just checking if the checked attribute is true for each radio button.

&lt;pre&gt;&lt;code&gt;if($('#testRadioYes').attr('checked') == true) {
	alert('Yes is selected');
}&lt;/code&gt;&lt;/pre&gt;

Again, there are a bunch of different ways to achieve this.</description>
		<content:encoded><![CDATA[<p>@Darrious-<br />
I think that there are surely a bunch of different ways to achieve what you are trying to do. I made an <a href="http://trevordavis.net/play/jqueryajaxform/jquery-radio-buttons/" rel="nofollow">example page</a> showing this.</p>
<p>When you hit submit, it will tell you which radio button is selected.  Basically, I am just checking if the checked attribute is true for each radio button.</p>
<pre><code>if($('#testRadioYes').attr('checked') == true) {
	alert('Yes is selected');
}</code></pre>
<p>Again, there are a bunch of different ways to achieve this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darrious</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-979</link>
		<dc:creator>Darrious</dc:creator>
		<pubDate>Mon, 30 Jun 2008 19:55:09 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-979</guid>
		<description>Yes, it is on the Javascript side.

I've tried both the original code: 
var radio_btnVal = $("#radio_btn").val(); 

And some other code:
var radio_btnVal = $("input[name='radio_btn']:checked").val();
___________________
I've also tried to assign each different values.
As such:
&#60;input type="radio"  class="other" name="radio_btn" id="radio_btn1" value=""   /&#62;  

&#60;input type="radio"  class="other" name="radio_btn" id="radio_btn2" value=""   /&#62;  
___________________
The original code that didn't work either:
&#60;input type="radio"  class="other" name="radio_btn" id="radio_btn" value=""   /&#62; 

I'm not sure exactly what jquery's expression would be for radio buttons.</description>
		<content:encoded><![CDATA[<p>Yes, it is on the Javascript side.</p>
<p>I&#8217;ve tried both the original code:<br />
var radio_btnVal = $(&#8220;#radio_btn&#8221;).val(); </p>
<p>And some other code:<br />
var radio_btnVal = $(&#8220;input[name=&#8217;radio_btn&#8217;]:checked&#8221;).val();<br />
___________________<br />
I&#8217;ve also tried to assign each different values.<br />
As such:<br />
&lt;input type=&#8221;radio&#8221;  class=&#8221;other&#8221; name=&#8221;radio_btn&#8221; id=&#8221;radio_btn1&#8221; value=&#8221;&#8221;   /&gt;  </p>
<p>&lt;input type=&#8221;radio&#8221;  class=&#8221;other&#8221; name=&#8221;radio_btn&#8221; id=&#8221;radio_btn2&#8221; value=&#8221;&#8221;   /&gt;<br />
___________________<br />
The original code that didn&#8217;t work either:<br />
&lt;input type=&#8221;radio&#8221;  class=&#8221;other&#8221; name=&#8221;radio_btn&#8221; id=&#8221;radio_btn&#8221; value=&#8221;&#8221;   /&gt; </p>
<p>I&#8217;m not sure exactly what jquery&#8217;s expression would be for radio buttons.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-978</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Mon, 30 Jun 2008 12:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-978</guid>
		<description>@Darrious-
What do you mean you are having trouble getting them working? Do you mean on the JavaScript side? Are you assigning values to the radio buttons?</description>
		<content:encoded><![CDATA[<p>@Darrious-<br />
What do you mean you are having trouble getting them working? Do you mean on the JavaScript side? Are you assigning values to the radio buttons?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darrious</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-977</link>
		<dc:creator>Darrious</dc:creator>
		<pubDate>Mon, 30 Jun 2008 03:44:35 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-977</guid>
		<description>I was wondering if anyone knew how to get radio buttons working? I'm having a tough trouble with getting them to work.</description>
		<content:encoded><![CDATA[<p>I was wondering if anyone knew how to get radio buttons working? I&#8217;m having a tough trouble with getting them to work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keenahn</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-971</link>
		<dc:creator>Keenahn</dc:creator>
		<pubDate>Thu, 26 Jun 2008 16:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-971</guid>
		<description>This is an excellent intro to jQuery. Kudos!

-K</description>
		<content:encoded><![CDATA[<p>This is an excellent intro to jQuery. Kudos!</p>
<p>-K</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gg</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-923</link>
		<dc:creator>gg</dc:creator>
		<pubDate>Wed, 11 Jun 2008 07:44:48 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-923</guid>
		<description>And I could not find success message as I submitted the comment.</description>
		<content:encoded><![CDATA[<p>And I could not find success message as I submitted the comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gg</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-922</link>
		<dc:creator>gg</dc:creator>
		<pubDate>Wed, 11 Jun 2008 07:41:17 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-922</guid>
		<description>I could not find "jqueryAjaxForm"</description>
		<content:encoded><![CDATA[<p>I could not find &#8220;jqueryAjaxForm&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-920</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 10 Jun 2008 09:53:07 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-920</guid>
		<description>Hmm, are you receiving any kind of error message? Do you have a page you can show us? The form pages could be HTML, but you would have to tweak a lot of stuff. The files that you downloaded need to be php, not phps. The phps files are source files, so that people can download them from the website.</description>
		<content:encoded><![CDATA[<p>Hmm, are you receiving any kind of error message? Do you have a page you can show us? The form pages could be HTML, but you would have to tweak a lot of stuff. The files that you downloaded need to be php, not phps. The phps files are source files, so that people can download them from the website.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-819</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Thu, 22 May 2008 00:51:20 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-819</guid>
		<description>@Martin-
Do you mean that there is a conflict between jQuery and Prototype? The jQuery documentation has an item about &lt;a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries" rel="nofollow"&gt;Using jQuery with Other Libraries&lt;/a&gt;. Hope that helps!</description>
		<content:encoded><![CDATA[<p>@Martin-<br />
Do you mean that there is a conflict between jQuery and Prototype? The jQuery documentation has an item about <a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries" rel="nofollow">Using jQuery with Other Libraries</a>. Hope that helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-818</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Wed, 21 May 2008 20:26:47 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-818</guid>
		<description>Very good and useful  , but it doesn't work with Prototype JavaScript (http://www.prototypejs.org) at once used in Lightbox(http://www.huddletogether.com/projects/lightbox2/). 

Do you have an idea why? Thanks for answer, regards.</description>
		<content:encoded><![CDATA[<p>Very good and useful  , but it doesn&#8217;t work with Prototype JavaScript (http://www.prototypejs.org) at once used in Lightbox(http://www.huddletogether.com/projects/lightbox2/). </p>
<p>Do you have an idea why? Thanks for answer, regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-674</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 09 Apr 2008 00:59:55 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-674</guid>
		<description>@John-
Glad that the example helped you. Yes, I have used the jQuery form plugin before. I would say the one advantage to using it is that there are a lot of functions already built into that plugin. If you don&#8217;t want to get your hands dirty writing your own stuff, sure, I would recommend using it.</description>
		<content:encoded><![CDATA[<p>@John-<br />
Glad that the example helped you. Yes, I have used the jQuery form plugin before. I would say the one advantage to using it is that there are a lot of functions already built into that plugin. If you don&rsquo;t want to get your hands dirty writing your own stuff, sure, I would recommend using it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-672</link>
		<dc:creator>john</dc:creator>
		<pubDate>Tue, 08 Apr 2008 20:21:39 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-672</guid>
		<description>Thank you for helping to educate newbies like me. 
I noticed that your example is not using the JQuery Form plug-in which has the AjaxForm and AjaxSubmit methods. What are your thoughts on the benefits of using those methods? Are you planning to include them in any future tutorial?</description>
		<content:encoded><![CDATA[<p>Thank you for helping to educate newbies like me.<br />
I noticed that your example is not using the JQuery Form plug-in which has the AjaxForm and AjaxSubmit methods. What are your thoughts on the benefits of using those methods? Are you planning to include them in any future tutorial?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-619</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Sat, 22 Mar 2008 05:28:11 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-619</guid>
		<description>@Fabi&#225;n-
The javascript does handle the client side. But, if a user does not have javascript enabled, then the PHP script will handle the validation.</description>
		<content:encoded><![CDATA[<p>@Fabi&aacute;n-<br />
The javascript does handle the client side. But, if a user does not have javascript enabled, then the PHP script will handle the validation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabián</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-618</link>
		<dc:creator>Fabián</dc:creator>
		<pubDate>Sat, 22 Mar 2008 04:11:57 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-618</guid>
		<description>It seems that the validation can only be done client-side, am I right?</description>
		<content:encoded><![CDATA[<p>It seems that the validation can only be done client-side, am I right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-612</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Tue, 18 Mar 2008 23:21:13 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-612</guid>
		<description>Johan-
I actually did upload the final PHP code. If you look at the end of the post, you can download them there.</description>
		<content:encoded><![CDATA[<p>Johan-<br />
I actually did upload the final PHP code. If you look at the end of the post, you can download them there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-611</link>
		<dc:creator>Johan</dc:creator>
		<pubDate>Tue, 18 Mar 2008 19:16:37 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-611</guid>
		<description>Hey!!

Thanks for this guide. :)
This helped me though my first AJAX. :D
...and trough  non-jQuery-guide to make a Captcha. :)

Thanks! :D

A little tip: If you also uploaded the final PHP-code, it would be much easier. ;)</description>
		<content:encoded><![CDATA[<p>Hey!!</p>
<p>Thanks for this guide. :)<br />
This helped me though my first AJAX. :D<br />
&#8230;and trough  non-jQuery-guide to make a Captcha. :)</p>
<p>Thanks! :D</p>
<p>A little tip: If you also uploaded the final PHP-code, it would be much easier. ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fiqhi</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-603</link>
		<dc:creator>Fiqhi</dc:creator>
		<pubDate>Mon, 17 Mar 2008 02:54:52 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-603</guid>
		<description>This is what I'm looking for! thanks trevor :)</description>
		<content:encoded><![CDATA[<p>This is what I&#8217;m looking for! thanks trevor :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaffer Haider</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-589</link>
		<dc:creator>Jaffer Haider</dc:creator>
		<pubDate>Mon, 10 Mar 2008 18:27:10 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-589</guid>
		<description>Nice example. From a Javascript code cleanliness point of view, it'd be better if you made a private function in the click listener, that checks if a form field is empty and sets the 'hasError' boolean to true, right?

I've recently shifted from Prototype to jQuery as well, and it rocks!</description>
		<content:encoded><![CDATA[<p>Nice example. From a Javascript code cleanliness point of view, it&#8217;d be better if you made a private function in the click listener, that checks if a form field is empty and sets the &#8216;hasError&#8217; boolean to true, right?</p>
<p>I&#8217;ve recently shifted from Prototype to jQuery as well, and it rocks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-541</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 27 Feb 2008 04:37:16 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-541</guid>
		<description>Paolo-
Hmm, I see what you are saying now. You could just use the $.ajax function and check the error that is returned (if there is one). It is more complex, and thus I&#8217;m not sure if it&#8217;s worth the hassle. Just don&#8217;t delete the files that you need to successfully complete the request!</description>
		<content:encoded><![CDATA[<p>Paolo-<br />
Hmm, I see what you are saying now. You could just use the $.ajax function and check the error that is returned (if there is one). It is more complex, and thus I&rsquo;m not sure if it&rsquo;s worth the hassle. Just don&rsquo;t delete the files that you need to successfully complete the request!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paolo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-528</link>
		<dc:creator>Paolo</dc:creator>
		<pubDate>Mon, 25 Feb 2008 16:21:05 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-528</guid>
		<description>"are saying the PHP file doesn’t exist" :-) No, no. It does exist and everything is fine. It's just that, if it didn't (say I delete it by mistake in 6 months' time), the system is not going to flag that up. 

At http://new.taize.fr/en
I do this:
$.post("squelettes/sendnews.php",
	    { Language: LangVal, Email: EmailVal, subscribe: SubVal },
	    function(data){
			if(data){
				$("#message").text('Your request was sent.');
			} else {
				$("#message").text('An error occurred. Your request could not be sent.');
			} ...
which works fine.  If the script doesn't find "sendnews.php" I would have liked to be able to display some kind of error message. That's all. And it's not a big deal. Perhaps this is what the jQuery site means about using $.ajax if you want to do error checking. I shall just be careful to make sure the file is in place!</description>
		<content:encoded><![CDATA[<p>&#8220;are saying the PHP file doesn’t exist&#8221; :-) No, no. It does exist and everything is fine. It&#8217;s just that, if it didn&#8217;t (say I delete it by mistake in 6 months&#8217; time), the system is not going to flag that up. </p>
<p>At <a href="http://new.taize.fr/en" rel="nofollow">http://new.taize.fr/en</a><br />
I do this:<br />
$.post(&#8220;squelettes/sendnews.php&#8221;,<br />
	    { Language: LangVal, Email: EmailVal, subscribe: SubVal },<br />
	    function(data){<br />
			if(data){<br />
				$(&#8220;#message&#8221;).text(&#8216;Your request was sent.&#8217;);<br />
			} else {<br />
				$(&#8220;#message&#8221;).text(&#8216;An error occurred. Your request could not be sent.&#8217;);<br />
			} &#8230;<br />
which works fine.  If the script doesn&#8217;t find &#8220;sendnews.php&#8221; I would have liked to be able to display some kind of error message. That&#8217;s all. And it&#8217;s not a big deal. Perhaps this is what the jQuery site means about using $.ajax if you want to do error checking. I shall just be careful to make sure the file is in place!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-527</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Mon, 25 Feb 2008 15:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-527</guid>
		<description>Paolo-
So you are saying the PHP file doesn&#8217;t exist on your server? I mean the simple and obvious answer is to move it into the correct location. I may not be understanding what you are saying is the problem. Do you have a link that we can see?</description>
		<content:encoded><![CDATA[<p>Paolo-<br />
So you are saying the PHP file doesn&rsquo;t exist on your server? I mean the simple and obvious answer is to move it into the correct location. I may not be understanding what you are saying is the problem. Do you have a link that we can see?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paolo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-525</link>
		<dc:creator>Paolo</dc:creator>
		<pubDate>Mon, 25 Feb 2008 10:44:41 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-525</guid>
		<description>Well, it all works --except for the case when the PHP file which does the mailing is not found. Then the whole thing seems to break down before getting as far as "function(data)", and I cannot get it to supply an error message. That's a minor concern, though.</description>
		<content:encoded><![CDATA[<p>Well, it all works &#8212;except for the case when the PHP file which does the mailing is not found. Then the whole thing seems to break down before getting as far as &#8220;function(data)&#8221;, and I cannot get it to supply an error message. That&#8217;s a minor concern, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paolo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-524</link>
		<dc:creator>Paolo</dc:creator>
		<pubDate>Mon, 25 Feb 2008 09:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-524</guid>
		<description>Trevor, This all works.  jQuery is good, isn't it? Clearly worth trying to learn properly! Thanks so much for the encouragement to do this.</description>
		<content:encoded><![CDATA[<p>Trevor, This all works.  jQuery is good, isn&#8217;t it? Clearly worth trying to learn properly! Thanks so much for the encouragement to do this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-521</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Mon, 25 Feb 2008 02:08:14 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-521</guid>
		<description>Paolo-
Glad the example has helped. 

In regards to your first question: &#8220;why use: &lt;strong&gt;function(data)&lt;/strong&gt; instead of just &lt;strong&gt;function()&lt;/strong&gt;&#8221;

I guess I didn&#8217;t need to use function(data) in this example, but I just did. Basically, if the PHP script that I am calling returns anything, I can access that value. Like in the PHP file, if I put &lt;strong&gt;echo 'hello';&lt;/strong&gt;, then if I add &lt;strong&gt;alert(data)&lt;/strong&gt; inside of the JavaScript callback function, it will alert &lt;strong&gt;hello&lt;/strong&gt;.

I guess my answer to the first question should answer your second question. You can certainly do some checking in the PHP file and return something if there is an error. Then just check the value of data in the JavaScript and see if there is an error.

Let me know if you need any other help.</description>
		<content:encoded><![CDATA[<p>Paolo-<br />
Glad the example has helped. </p>
<p>In regards to your first question: &ldquo;why use: <strong>function(data)</strong> instead of just <strong>function()</strong>&rdquo;</p>
<p>I guess I didn&rsquo;t need to use function(data) in this example, but I just did. Basically, if the PHP script that I am calling returns anything, I can access that value. Like in the PHP file, if I put <strong>echo &#8216;hello&#8217;;</strong>, then if I add <strong>alert(data)</strong> inside of the JavaScript callback function, it will alert <strong>hello</strong>.</p>
<p>I guess my answer to the first question should answer your second question. You can certainly do some checking in the PHP file and return something if there is an error. Then just check the value of data in the JavaScript and see if there is an error.</p>
<p>Let me know if you need any other help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paolo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-518</link>
		<dc:creator>Paolo</dc:creator>
		<pubDate>Sun, 24 Feb 2008 21:38:20 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-518</guid>
		<description>Thank you, Trevor, this has been very useful indeed. I am trying out a simplified form of this on http://new.taize.fr/en 

I have one question, and one lingering concern: 

In submitting the post request why use:  "function(data){" instead of just "function(){" --which in my case anyway, seems to work just as well (or does it?)?

Would it not be better to get an error message if, for some reason, the mailing fails (for example the php file is not found)? As far as I can understand from the jQuery doc this involves using $.ajax instead of $.post. And that looks complicated ...</description>
		<content:encoded><![CDATA[<p>Thank you, Trevor, this has been very useful indeed. I am trying out a simplified form of this on <a href="http://new.taize.fr/en" rel="nofollow">http://new.taize.fr/en</a> </p>
<p>I have one question, and one lingering concern: </p>
<p>In submitting the post request why use:  &#8220;function(data){&#8221; instead of just &#8220;function(){&#8221; &#8212;which in my case anyway, seems to work just as well (or does it?)?</p>
<p>Would it not be better to get an error message if, for some reason, the mailing fails (for example the php file is not found)? As far as I can understand from the jQuery doc this involves using $.ajax instead of $.post. And that looks complicated &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-479</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Sun, 17 Feb 2008 01:05:35 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-479</guid>
		<description>Jon-
Hmm, are you receiving any kind of error message? Do you have a page you can show us? The form pages could be HTML, but you would have to tweak a lot of stuff. The files that you downloaded need to be php, not phps. The phps files are source files, so that people can download them from the website. Let me know how I can help.</description>
		<content:encoded><![CDATA[<p>Jon-<br />
Hmm, are you receiving any kind of error message? Do you have a page you can show us? The form pages could be HTML, but you would have to tweak a lot of stuff. The files that you downloaded need to be php, not phps. The phps files are source files, so that people can download them from the website. Let me know how I can help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Mallow</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-477</link>
		<dc:creator>Jon Mallow</dc:creator>
		<pubDate>Sat, 16 Feb 2008 12:11:15 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-477</guid>
		<description>I'm not an expert at Ajax and jQuery, but I've dabbled in them enough to think that I know what I'm doing.

However, I can't seem to even be able to replicate this. I can copy all the files and even the pages you use on the internet and still not get this to work.

So what am I forgetting to do that isn't shown on the website? are the form pages php or html? am I supposed to leave the s on phps? It started to work a little better when I kept the s on.

I'm just a wee bit confused, followed the instructions and made some custom fields in the beginning, but that didn't work out, so i did a dumber down version, still didn't work. Now that I can't even get your version to work I know I'm doing something wrong :P

Thanks,
Jon</description>
		<content:encoded><![CDATA[<p>I&#8217;m not an expert at Ajax and jQuery, but I&#8217;ve dabbled in them enough to think that I know what I&#8217;m doing.</p>
<p>However, I can&#8217;t seem to even be able to replicate this. I can copy all the files and even the pages you use on the internet and still not get this to work.</p>
<p>So what am I forgetting to do that isn&#8217;t shown on the website? are the form pages php or html? am I supposed to leave the s on phps? It started to work a little better when I kept the s on.</p>
<p>I&#8217;m just a wee bit confused, followed the instructions and made some custom fields in the beginning, but that didn&#8217;t work out, so i did a dumber down version, still didn&#8217;t work. Now that I can&#8217;t even get your version to work I know I&#8217;m doing something wrong :P</p>
<p>Thanks,<br />
Jon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-307</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Thu, 24 Jan 2008 19:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-307</guid>
		<description>@Andy-
Awesome! I&#8217;m glad that the tutorial was helpful. No worries about not giving me credit, anything to make the web a better place.</description>
		<content:encoded><![CDATA[<p>@Andy-<br />
Awesome! I&rsquo;m glad that the tutorial was helpful. No worries about not giving me credit, anything to make the web a better place.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Bailey</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-294</link>
		<dc:creator>Andy Bailey</dc:creator>
		<pubDate>Mon, 21 Jan 2008 20:00:32 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-294</guid>
		<description>I have to tell you that this bit of code and explanation has caused a paradigm shift in my AJAX knowledge. I really appreciate you putting this post up and sharing your code. I have downloaded, edited and installed this to my current AJAX site project and it works really well. (I've already been praised for my ingenuity too, sorry, I didn't pass the credit on!... :-P)

a big thumbs up!</description>
		<content:encoded><![CDATA[<p>I have to tell you that this bit of code and explanation has caused a paradigm shift in my AJAX knowledge. I really appreciate you putting this post up and sharing your code. I have downloaded, edited and installed this to my current AJAX site project and it works really well. (I&#8217;ve already been praised for my ingenuity too, sorry, I didn&#8217;t pass the credit on!&#8230; :-P)</p>
<p>a big thumbs up!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-145</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Fri, 21 Dec 2007 04:18:07 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-145</guid>
		<description>Jack-
Sorry about that, I think they got lost when I redesigned. Should be able to download them now. Let me know if you still have trouble.</description>
		<content:encoded><![CDATA[<p>Jack-<br />
Sorry about that, I think they got lost when I redesigned. Should be able to download them now. Let me know if you still have trouble.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jack</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-178</link>
		<dc:creator>jack</dc:creator>
		<pubDate>Thu, 20 Dec 2007 16:04:37 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-178</guid>
		<description>I can't download the php files at the bottom. I&#8217;ve tried both on a PC and Mac with Firefox. Could you please fix this?</description>
		<content:encoded><![CDATA[<p>I can&#8217;t download the php files at the bottom. I&rsquo;ve tried both on a PC and Mac with Firefox. Could you please fix this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-140</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 19 Sep 2007 13:15:53 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-140</guid>
		<description>@huljo-
The PHP files that I used are now included for download at the bottom of this entry. Let me know if you have any other questions.</description>
		<content:encoded><![CDATA[<p>@huljo-<br />
The PHP files that I used are now included for download at the bottom of this entry. Let me know if you have any other questions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: huljo</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-144</link>
		<dc:creator>huljo</dc:creator>
		<pubDate>Wed, 19 Sep 2007 06:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-144</guid>
		<description>Is there any chance we can see the PHP script as well? I'm having a hard time wrapping myself around how this is listening for a successful execution by PHP. To make sure everything on the server executed as planned.  Or is this only client-side validation?</description>
		<content:encoded><![CDATA[<p>Is there any chance we can see the PHP script as well? I&#8217;m having a hard time wrapping myself around how this is listening for a successful execution by PHP. To make sure everything on the server executed as planned.  Or is this only client-side validation?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-143</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Mon, 17 Sep 2007 13:21:31 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-143</guid>
		<description>Hmm yeah that&#8217;s what you would think, but the form still submits when you hit enter in a form field. I guess that makes sense.

I guess when you hit enter in any form field it acts as though the submit button is &#8220;clicked&#8221;.</description>
		<content:encoded><![CDATA[<p>Hmm yeah that&rsquo;s what you would think, but the form still submits when you hit enter in a form field. I guess that makes sense.</p>
<p>I guess when you hit enter in any form field it acts as though the submit button is &ldquo;clicked&rdquo;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Hemphill</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-142</link>
		<dc:creator>David Hemphill</dc:creator>
		<pubDate>Mon, 17 Sep 2007 06:51:47 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-142</guid>
		<description>I was excited to see such a good example of jQuery's ajax functions online. Well done.

The only reason I can see having the function fire onsubmit is in the case of the user hitting enter to submit the form.</description>
		<content:encoded><![CDATA[<p>I was excited to see such a good example of jQuery&#8217;s ajax functions online. Well done.</p>
<p>The only reason I can see having the function fire onsubmit is in the case of the user hitting enter to submit the form.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-138</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Sun, 09 Sep 2007 18:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-138</guid>
		<description>@dean
Well, you could definitely have the function fire on the onsubmit event of the form, but it shouldn&#8217;t function any differently.

Why do you think it would be better?</description>
		<content:encoded><![CDATA[<p>@dean<br />
Well, you could definitely have the function fire on the onsubmit event of the form, but it shouldn&rsquo;t function any differently.</p>
<p>Why do you think it would be better?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dean</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-139</link>
		<dc:creator>Dean</dc:creator>
		<pubDate>Sun, 09 Sep 2007 17:05:32 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-139</guid>
		<description>Instead of tying your function to the onclick event of the submit button wouldn't it be better to attach it to the onsubmit event of the form?</description>
		<content:encoded><![CDATA[<p>Instead of tying your function to the onclick event of the submit button wouldn&#8217;t it be better to attach it to the onsubmit event of the form?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronald Allan</title>
		<link>http://trevordavis.net/blog/tutorial/ajax-forms-with-jquery/#comment-141</link>
		<dc:creator>Ronald Allan</dc:creator>
		<pubDate>Sat, 08 Sep 2007 17:49:42 +0000</pubDate>
		<guid isPermaLink="false">http://trevordavis.net/?p=30#comment-141</guid>
		<description>ei thanks! i will try this code.. actually i need this kind of code for my new project.

thanks again!</description>
		<content:encoded><![CDATA[<p>ei thanks! i will try this code.. actually i need this kind of code for my new project.</p>
<p>thanks again!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
