<?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: Drupal Tutorial: Form Overrides and Element-Specific Validations</title>
	<atom:link href="http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/</link>
	<description>Professional web design and creative company CHROMATIC's blog.</description>
	<lastBuildDate>Thu, 10 Jun 2010 01:28:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Stuart Eske</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-9115</link>
		<dc:creator>Stuart Eske</dc:creator>
		<pubDate>Mon, 12 Apr 2010 14:04:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-9115</guid>
		<description>Great tutorial, it touched on multiple subjects and helped me out.</description>
		<content:encoded><![CDATA[<p>Great tutorial, it touched on multiple subjects and helped me out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Codebyzz</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-9044</link>
		<dc:creator>Codebyzz</dc:creator>
		<pubDate>Mon, 22 Feb 2010 06:12:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-9044</guid>
		<description>Hi Chris, thanks for the great post. It&#039;s easy to understand for newbies like me. BTW, just wondering let&#039;s say that I added a drop down field in the user registration page, and I would need to update the user_profile and send email to the admin based on the value of that drop down field. Is it possible?

Cos I&#039;m not sure where the form would go after the user clicked on &quot;submit&quot; in the registration page. And where will my drop down value be stored in.</description>
		<content:encoded><![CDATA[<p>Hi Chris, thanks for the great post. It&#8217;s easy to understand for newbies like me. BTW, just wondering let&#8217;s say that I added a drop down field in the user registration page, and I would need to update the user_profile and send email to the admin based on the value of that drop down field. Is it possible?</p>
<p>Cos I&#8217;m not sure where the form would go after the user clicked on &#8220;submit&#8221; in the registration page. And where will my drop down value be stored in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Parkins</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8963</link>
		<dc:creator>Joe Parkins</dc:creator>
		<pubDate>Wed, 30 Dec 2009 20:15:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8963</guid>
		<description>I second that. Thanks!</description>
		<content:encoded><![CDATA[<p>I second that. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8921</link>
		<dc:creator>Al</dc:creator>
		<pubDate>Wed, 25 Nov 2009 18:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8921</guid>
		<description>OMG!!! Thank you for this write up, saved me on one of my current projects :) THANK YOU</description>
		<content:encoded><![CDATA[<p>OMG!!! Thank you for this write up, saved me on one of my current projects <img src='http://www.chromaticsites.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  THANK YOU</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8908</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 13 Nov 2009 16:34:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8908</guid>
		<description>Hi Jamie - thanks for reading. I&#039;m glad to see so many people have found this tutorial helpful.  Let me know how it goes!</description>
		<content:encoded><![CDATA[<p>Hi Jamie &#8211; thanks for reading. I&#8217;m glad to see so many people have found this tutorial helpful.  Let me know how it goes!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8907</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 13 Nov 2009 16:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8907</guid>
		<description>Hi Arnold - Thanks for posting.  If you are only overriding the #value of the submit button, it shouldn&#039;t change anything else (validations, submit callbacks, etc.).  Are you sure you haven&#039;t overridden other parts of the form?  I&#039;d be happy to look at your code.</description>
		<content:encoded><![CDATA[<p>Hi Arnold &#8211; Thanks for posting.  If you are only overriding the #value of the submit button, it shouldn&#8217;t change anything else (validations, submit callbacks, etc.).  Are you sure you haven&#8217;t overridden other parts of the form?  I&#8217;d be happy to look at your code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Giberti</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8905</link>
		<dc:creator>Jamie Giberti</dc:creator>
		<pubDate>Fri, 13 Nov 2009 11:48:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8905</guid>
		<description>Hi Chris,

Awesome post. I&#039;m in the process of modifying the user_register form on our site as we speak, we&#039;re adding a survey to the process (which can also be accessed in other places), and it&#039;s just nice to see someone adopt the same approach as me (the only thing I haven&#039;t done yet is write an Admin screen to view the results of the survey). Just about to try and implement your element validation pointers, I&#039;m in need of overriding the default validation and I think that&#039;s what I need!</description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>Awesome post. I&#8217;m in the process of modifying the user_register form on our site as we speak, we&#8217;re adding a survey to the process (which can also be accessed in other places), and it&#8217;s just nice to see someone adopt the same approach as me (the only thing I haven&#8217;t done yet is write an Admin screen to view the results of the survey). Just about to try and implement your element validation pointers, I&#8217;m in need of overriding the default validation and I think that&#8217;s what I need!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arnold</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8897</link>
		<dc:creator>Arnold</dc:creator>
		<pubDate>Fri, 06 Nov 2009 09:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8897</guid>
		<description>Hi, I tried changing the #value of the submit button in my registration form since I think it&#039;s &#039;Create new account&#039; when what I wanted was &#039;Create New Account&#039;. After changing it, the form wasn&#039;t functioning well. It didn&#039;t display any errors but it didn&#039;t also register the new account I&#039;ve created.</description>
		<content:encoded><![CDATA[<p>Hi, I tried changing the #value of the submit button in my registration form since I think it&#8217;s &#8216;Create new account&#8217; when what I wanted was &#8216;Create New Account&#8217;. After changing it, the form wasn&#8217;t functioning well. It didn&#8217;t display any errors but it didn&#8217;t also register the new account I&#8217;ve created.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Athena</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8893</link>
		<dc:creator>Athena</dc:creator>
		<pubDate>Tue, 03 Nov 2009 19:57:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8893</guid>
		<description>Hello Chris, Hi, I am here again.. back like a bad coin, lol. Sorry to disturb again. But I just wanted to inform you that I solved my problem. I must say that Autoassign Role is a great module: very neat and user friendly. Earler I missed a very important point and failed to see that it has also created a role option in content type, which I didnt check. Once I checked it, it created very neat menu items directing users to different registration forms. Now I seek your help about one thing. These menu items: Post resume and Post Job are not visible when I login as admin (super user). But when I log out they become visible. Isn&#039;t it possible that all menus are always visible and when a user (without proper permission) clicks there, he gets a page, telling him that: (say) the access to the page in his present role is denied and if he wants to carry on this task ..he should do such and such things.... How can I achieve this? Please guide me. Thanks again.</description>
		<content:encoded><![CDATA[<p>Hello Chris, Hi, I am here again.. back like a bad coin, lol. Sorry to disturb again. But I just wanted to inform you that I solved my problem. I must say that Autoassign Role is a great module: very neat and user friendly. Earler I missed a very important point and failed to see that it has also created a role option in content type, which I didnt check. Once I checked it, it created very neat menu items directing users to different registration forms. Now I seek your help about one thing. These menu items: Post resume and Post Job are not visible when I login as admin (super user). But when I log out they become visible. Isn&#8217;t it possible that all menus are always visible and when a user (without proper permission) clicks there, he gets a page, telling him that: (say) the access to the page in his present role is denied and if he wants to carry on this task ..he should do such and such things&#8230;. How can I achieve this? Please guide me. Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Athena</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8892</link>
		<dc:creator>Athena</dc:creator>
		<pubDate>Tue, 03 Nov 2009 10:17:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8892</guid>
		<description>Hello Chris, Many of my friends are so impressed by your skill and expertise that reading ur every new tutorial is a must do for them. As such I am a newb for Drupal. Though I&#039;ve command on css and html, PHP remains a greek to me and so I am unable to use Drupal&#039;s alter hook function for various customisation. It will be very sweet of you if you could guide me on certain aspects as I am trying to build a job site. 
For that I want two user registrations: One for Jobseeker and another for Employer with proper link in primary menu as &quot;Post Resume&quot; (for Jobseeker regn) and &quot;Post Job&quot; (for employer regn)
I have created two content types: Resume and Job with added cck fields and connected both to Content profile with check on use on registration. Taking a cue from your reply to manu&#039;s query, I&#039;ve also restricted field permission for different roles.
Now my problem is : how to create two different menus: Post Resume and Post job .. for different role types. Unless a different role is auto assigned from menu, it shows all the fields in user registations.
I tried menu per role module. but it just hides menu and doesnt assign role. 
Earlier I had also tried Auto Assign Role module. But, though it is creating role based menu but showing just basic drupal registration form without those special fields for resume uploads or job descriptions for respective roles. 
I have tried many different modules and all sort of permutation combination, but still no success.
Please guide me as to how to create two different type of registered users. Thanking you.</description>
		<content:encoded><![CDATA[<p>Hello Chris, Many of my friends are so impressed by your skill and expertise that reading ur every new tutorial is a must do for them. As such I am a newb for Drupal. Though I&#8217;ve command on css and html, PHP remains a greek to me and so I am unable to use Drupal&#8217;s alter hook function for various customisation. It will be very sweet of you if you could guide me on certain aspects as I am trying to build a job site.<br />
For that I want two user registrations: One for Jobseeker and another for Employer with proper link in primary menu as &#8220;Post Resume&#8221; (for Jobseeker regn) and &#8220;Post Job&#8221; (for employer regn)<br />
I have created two content types: Resume and Job with added cck fields and connected both to Content profile with check on use on registration. Taking a cue from your reply to manu&#8217;s query, I&#8217;ve also restricted field permission for different roles.<br />
Now my problem is : how to create two different menus: Post Resume and Post job .. for different role types. Unless a different role is auto assigned from menu, it shows all the fields in user registations.<br />
I tried menu per role module. but it just hides menu and doesnt assign role.<br />
Earlier I had also tried Auto Assign Role module. But, though it is creating role based menu but showing just basic drupal registration form without those special fields for resume uploads or job descriptions for respective roles.<br />
I have tried many different modules and all sort of permutation combination, but still no success.<br />
Please guide me as to how to create two different type of registered users. Thanking you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8890</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 02 Nov 2009 16:58:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8890</guid>
		<description>Manu - do your users need permission to create revisions, or alter menus?  If not, removing their access permissions (admin/users/permissions) should remove those elements from the form.  Otherwise, simply unsetting the fieldset variables should do the trick.  Make sure to dump your cache after making these changes - Drupal caches these forms to improve load times.  Hope this helps!</description>
		<content:encoded><![CDATA[<p>Manu &#8211; do your users need permission to create revisions, or alter menus?  If not, removing their access permissions (admin/users/permissions) should remove those elements from the form.  Otherwise, simply unsetting the fieldset variables should do the trick.  Make sure to dump your cache after making these changes &#8211; Drupal caches these forms to improve load times.  Hope this helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manu Adam</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8888</link>
		<dc:creator>Manu Adam</dc:creator>
		<pubDate>Sat, 31 Oct 2009 08:06:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8888</guid>
		<description>Hi Chris, Thanks for your a great tutorial. I implemented your form override plan and it worked perfectly. I now prefer this to even legal module because your alteration is so nicely compact. I must say it is a very good work by you and the way you explained it step by step was superb. I tried to further add a few more items by adding some more codes in this form over ride module but I could not succeed. I basically wanted to get rid of those additional items in the forms which are unnecessary for the users in order to present to them a Compact form. For that I wanted to remove field groups like Menu, Path, Publishing Option, Book outline, Comment setting, revision information etc. for that.. I added additional line your form override module: 
function form_overrides_form_resume_node_form_alter(&amp;$form, $form_state, $form_id) {
  if ($form[&#039;#id&#039;] == &#039;node-form&#039;) {
    
    // Move all path options to publishing options
    if ($form[&#039;path&#039;]) {
      $form[&#039;options&#039;][&#039;path&#039;] = $form[&#039;path&#039;];
      unset($form[&#039;path&#039;]);
    }

 
    if ($form[&#039;#id&#039;] == &#039;node-form&#039;) {
    
    // Move all path options to publishing options
    if ($form[&#039;menu&#039;]) {
      $form[&#039;options&#039;][&#039;menu&#039;] = $form[&#039;menu&#039;];
      unset($form[&#039;menu&#039;]);
    }
}
}
Here i must explain that my form id is resume_node_form. I also tried : $form[&#039;menu&#039;][&#039;#access&#039;] = FALSE; in the place of unset. But it didnt work as I see all those irritating field groups still in the form. it will be very kind of you if you could guide me and tell what needs to be done to get rid of these unnecessary field groups -- the best way to do so. Thanking you once again.</description>
		<content:encoded><![CDATA[<p>Hi Chris, Thanks for your a great tutorial. I implemented your form override plan and it worked perfectly. I now prefer this to even legal module because your alteration is so nicely compact. I must say it is a very good work by you and the way you explained it step by step was superb. I tried to further add a few more items by adding some more codes in this form over ride module but I could not succeed. I basically wanted to get rid of those additional items in the forms which are unnecessary for the users in order to present to them a Compact form. For that I wanted to remove field groups like Menu, Path, Publishing Option, Book outline, Comment setting, revision information etc. for that.. I added additional line your form override module:<br />
function form_overrides_form_resume_node_form_alter(&amp;$form, $form_state, $form_id) {<br />
  if ($form['#id'] == &#8216;node-form&#8217;) {</p>
<p>    // Move all path options to publishing options<br />
    if ($form['path']) {<br />
      $form['options']['path'] = $form['path'];<br />
      unset($form['path']);<br />
    }</p>
<p>    if ($form['#id'] == &#8216;node-form&#8217;) {</p>
<p>    // Move all path options to publishing options<br />
    if ($form['menu']) {<br />
      $form['options']['menu'] = $form['menu'];<br />
      unset($form['menu']);<br />
    }<br />
}<br />
}<br />
Here i must explain that my form id is resume_node_form. I also tried : $form['menu']['#access'] = FALSE; in the place of unset. But it didnt work as I see all those irritating field groups still in the form. it will be very kind of you if you could guide me and tell what needs to be done to get rid of these unnecessary field groups &#8212; the best way to do so. Thanking you once again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nguyen hoang</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8883</link>
		<dc:creator>nguyen hoang</dc:creator>
		<pubDate>Sat, 24 Oct 2009 19:24:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8883</guid>
		<description>Thanks for the great tutorial on form alter.
I m using webform module. I want to include a default Country text field for all webform created.
But the form_id is changed with the node id so i can&#039;t use this value to add default form.
When i look at webform.module, i see this &quot;webform_node_form&quot;, i tried this for the $form_id but no luck.
Does webform have a global id?
Can you advice me for a  solution?
If not, all i can do is to add code directly to webform.module.</description>
		<content:encoded><![CDATA[<p>Thanks for the great tutorial on form alter.<br />
I m using webform module. I want to include a default Country text field for all webform created.<br />
But the form_id is changed with the node id so i can&#8217;t use this value to add default form.<br />
When i look at webform.module, i see this &#8220;webform_node_form&#8221;, i tried this for the $form_id but no luck.<br />
Does webform have a global id?<br />
Can you advice me for a  solution?<br />
If not, all i can do is to add code directly to webform.module.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: morgan</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8835</link>
		<dc:creator>morgan</dc:creator>
		<pubDate>Fri, 18 Sep 2009 04:54:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8835</guid>
		<description>Hi,

I just need to make some simple changes to the help text under certain fields in the user registration form. For example, I&#039;d like to add something under the username field where it reads:
&quot;Spaces are allowed; punctuation is not allowed except for periods, hyphens, and underscores.&quot;

Is there any easy way to do this without writing a custom module?

thanks!</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I just need to make some simple changes to the help text under certain fields in the user registration form. For example, I&#8217;d like to add something under the username field where it reads:<br />
&#8220;Spaces are allowed; punctuation is not allowed except for periods, hyphens, and underscores.&#8221;</p>
<p>Is there any easy way to do this without writing a custom module?</p>
<p>thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8815</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Tue, 01 Sep 2009 17:32:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.chromaticsites.com/blog/drupal-tutorial-form-overrides-and-element-specific-validations/#comment-8815</guid>
		<description>Chris Pall,

Thanks for your comment.  As for your question, &#039;hook_form_alter()&#039; likely isn&#039;t what you need.  Since the Page Title has already been set by the time the form is prepared for rendering.  I would suggest a simple preprocess override in template.php.  For example, to alter the title of a particular page, you would use this function: 

function phptemplate_preprocess_page(&amp;$vars, $hook) { 
  // if some condition is true (you are viewing your node creation page)
  if ($vars[&#039;title&#039;] == &#039;Create Arbitrary Content Type&#039;) {
    $vars[&#039;title&#039;] = &#039;My New Title&#039;;
  }
}

Be sure to rebuild your menus after adding this to template.php.  Hope this helps!</description>
		<content:encoded><![CDATA[<p>Chris Pall,</p>
<p>Thanks for your comment.  As for your question, &#8216;hook_form_alter()&#8217; likely isn&#8217;t what you need.  Since the Page Title has already been set by the time the form is prepared for rendering.  I would suggest a simple preprocess override in template.php.  For example, to alter the title of a particular page, you would use this function: </p>
<p>function phptemplate_preprocess_page(&#038;$vars, $hook) {<br />
  // if some condition is true (you are viewing your node creation page)<br />
  if ($vars['title'] == &#8216;Create Arbitrary Content Type&#8217;) {<br />
    $vars['title'] = &#8216;My New Title&#8217;;<br />
  }<br />
}</p>
<p>Be sure to rebuild your menus after adding this to template.php.  Hope this helps!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
