<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: ClientSide Username Checking, EE and jQuery</title>
	<atom:link href="http://cwcrawley.co.uk/2010/07/clientside-username-checking-expressionengine-and-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://cwcrawley.co.uk/2010/07/clientside-username-checking-expressionengine-and-jquery/</link>
	<description>Random posts of a programmer, martial artist, gamer and general geek</description>
	<lastBuildDate>Wed, 11 Aug 2010 15:09:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Carl Crawley</title>
		<link>http://cwcrawley.co.uk/2010/07/clientside-username-checking-expressionengine-and-jquery/comment-page-1/#comment-4785</link>
		<dc:creator>Carl Crawley</dc:creator>
		<pubDate>Wed, 28 Jul 2010 20:32:07 +0000</pubDate>
		<guid isPermaLink="false">http://cwcrawley.co.uk/?p=147#comment-4785</guid>
		<description>Splitting the value based on the @ is relatively simple, but yet this does rely on having the email address.

Your second point is also quite valid, although any site which allows a username such as &quot;Dr. M&#039;Benga&quot; - I would question. ;) 

You could extend the functionality I&#039;ve written to validate the fields to ensure that spaces are not allowed, special characters etc (unless you&#039;re using email as username)

It&#039;s certainly not intended as a foolproof solution, but it&#039;s a basis which you could use to extend with relative ease (or contract my services to do it! :-)) 

Each case is different as you&#039;ve quite rightly mentioned - hopefully it&#039;ll give inspiration.

C</description>
		<content:encoded><![CDATA[<p>Splitting the value based on the @ is relatively simple, but yet this does rely on having the email address.</p>
<p>Your second point is also quite valid, although any site which allows a username such as &#8220;Dr. M&#8217;Benga&#8221; &#8211; I would question. <img src='http://cwcrawley.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </p>
<p>You could extend the functionality I&#8217;ve written to validate the fields to ensure that spaces are not allowed, special characters etc (unless you&#8217;re using email as username)</p>
<p>It&#8217;s certainly not intended as a foolproof solution, but it&#8217;s a basis which you could use to extend with relative ease (or contract my services to do it! <img src='http://cwcrawley.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ) </p>
<p>Each case is different as you&#8217;ve quite rightly mentioned &#8211; hopefully it&#8217;ll give inspiration.</p>
<p>C</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael C.</title>
		<link>http://cwcrawley.co.uk/2010/07/clientside-username-checking-expressionengine-and-jquery/comment-page-1/#comment-4784</link>
		<dc:creator>Michael C.</dc:creator>
		<pubDate>Wed, 28 Jul 2010 20:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://cwcrawley.co.uk/?p=147#comment-4784</guid>
		<description>Yeah, that would work too, but that would require a tiny bit more than elementary-level Javascript skills to implement, and thus is beyond me. ;)

The problem with that, however, is relying on splitting the value at the @. What if the field you&#039;re checking doesn&#039;t have an email address for content, but something else that EE blocks? Say, if you&#039;re checking the user&#039;s desired screen name (which apparently has to be unique unless you hack the core files), and a user wants the screen name &quot;Dr. M&#039;Benga&quot;, you run into problems with the apostrophe (and possibly the space as well).</description>
		<content:encoded><![CDATA[<p>Yeah, that would work too, but that would require a tiny bit more than elementary-level Javascript skills to implement, and thus is beyond me. <img src='http://cwcrawley.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The problem with that, however, is relying on splitting the value at the @. What if the field you&#8217;re checking doesn&#8217;t have an email address for content, but something else that EE blocks? Say, if you&#8217;re checking the user&#8217;s desired screen name (which apparently has to be unique unless you hack the core files), and a user wants the screen name &#8220;Dr. M&#8217;Benga&#8221;, you run into problems with the apostrophe (and possibly the space as well).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carl Crawley</title>
		<link>http://cwcrawley.co.uk/2010/07/clientside-username-checking-expressionengine-and-jquery/comment-page-1/#comment-4782</link>
		<dc:creator>Carl Crawley</dc:creator>
		<pubDate>Wed, 28 Jul 2010 19:44:03 +0000</pubDate>
		<guid isPermaLink="false">http://cwcrawley.co.uk/?p=147#comment-4782</guid>
		<description>Interesting... The other way potentially would be to split the value based on @? So then you get /user_check/email/domain.com

Then you could just reconstitute the link {segment_2}@{segment_3} ?

</description>
		<content:encoded><![CDATA[<p>Interesting&#8230; The other way potentially would be to split the value based on @? So then you get /user_check/email/domain.com</p>
<p>Then you could just reconstitute the link {segment_2}@{segment_3} ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael C.</title>
		<link>http://cwcrawley.co.uk/2010/07/clientside-username-checking-expressionengine-and-jquery/comment-page-1/#comment-4781</link>
		<dc:creator>Michael C.</dc:creator>
		<pubDate>Wed, 28 Jul 2010 19:40:44 +0000</pubDate>
		<guid isPermaLink="false">http://cwcrawley.co.uk/?p=147#comment-4781</guid>
		<description>Actually, you can’t (I think). If the URLEncode() converts the @ into %40, it still triggers EE’s security and returns the “Disallowed Key Characters”.
The workaround I figured out was to use PHP and some custom URL wrangling. The query would then be:

&lt;code&gt;
{exp:query sql=&quot;select username from exp_members where username = &#039;&#039;&lt;?php echo $_GET[&#039;username&#039;]; ?&gt;&quot;}
{username}
{/exp:query}
&lt;/code&gt;

Obviously, PHP would need to be enabled for that template, and set to Input. The script would also need to be changed; the “url: ‘…’” line would read:

&lt;code&gt;
....
/index.php?/assets/username_check/&amp;username=&#039;+$(this).val(),
...
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Actually, you can’t (I think). If the URLEncode() converts the @ into %40, it still triggers EE’s security and returns the “Disallowed Key Characters”.<br />
The workaround I figured out was to use PHP and some custom URL wrangling. The query would then be:</p>
<p><code><br />
{exp:query sql="select username from exp_members where username = ''< ?php echo $_GET['username']; ?>"}<br />
{username}<br />
{/exp:query}<br />
</code></p>
<p>Obviously, PHP would need to be enabled for that template, and set to Input. The script would also need to be changed; the “url: ‘…’” line would read:</p>
<p><code><br />
....<br />
/index.php?/assets/username_check/&#038;username='+$(this).val(),<br />
...<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carl Crawley</title>
		<link>http://cwcrawley.co.uk/2010/07/clientside-username-checking-expressionengine-and-jquery/comment-page-1/#comment-4774</link>
		<dc:creator>Carl Crawley</dc:creator>
		<pubDate>Wed, 28 Jul 2010 16:05:39 +0000</pubDate>
		<guid isPermaLink="false">http://cwcrawley.co.uk/?p=147#comment-4774</guid>
		<description>Good point... In theory of course, you could just URLEncode() the email address in the jQuery and then URLDecode it back before you do the SQL statement and job done.

Regards,

Carl.</description>
		<content:encoded><![CDATA[<p>Good point&#8230; In theory of course, you could just URLEncode() the email address in the jQuery and then URLDecode it back before you do the SQL statement and job done.</p>
<p>Regards,</p>
<p>Carl.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael C.</title>
		<link>http://cwcrawley.co.uk/2010/07/clientside-username-checking-expressionengine-and-jquery/comment-page-1/#comment-4773</link>
		<dc:creator>Michael C.</dc:creator>
		<pubDate>Wed, 28 Jul 2010 15:49:31 +0000</pubDate>
		<guid isPermaLink="false">http://cwcrawley.co.uk/?p=147#comment-4773</guid>
		<description>If you have SolSpace&#039;s User module and are using the &quot;Email as Username&quot; option, this won&#039;t work, as EE&#039;s URL parsing functions don&#039;t allow @ signs in the URL; you&#039;ll get a &quot;Disallowed Key Characters&quot; error when viewing the template.

If anyone has a workaround to this, please post it. :)</description>
		<content:encoded><![CDATA[<p>If you have SolSpace&#8217;s User module and are using the &#8220;Email as Username&#8221; option, this won&#8217;t work, as EE&#8217;s URL parsing functions don&#8217;t allow @ signs in the URL; you&#8217;ll get a &#8220;Disallowed Key Characters&#8221; error when viewing the template.</p>
<p>If anyone has a workaround to this, please post it. <img src='http://cwcrawley.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

