How to remove "Anonymous" name from comment form

I've decided to use Drupal for a totally minimalistic website, which I'm sure I would be able to put together from scratch in just a few days. Anyway, I take it as a good exercise in altering and theming even the tiniest elements of a Drupal system.

I ran into a couple of problems while working on the website, but I spent most time on trying to remove the default value from the comment form Name input box. For such a small modification, a few hour struggle has been long enough to trigger a blog post.

The website itself consists from only three pages:

  1. a home page with an image on it,
  2. a stupid simple photo gallery, for which the Slideshow module was a perfect fit, and
  3. a guestbook -- an empty Story node with comments enabled.

I've been trying to keep it small even theming wise, so I use Zen's STARTERKIT sub-module. Everything was good and fine until I decided to rename Comments to Messages and only require visitor's name and message body to be entered.

I just didn't seem to be able to remove the Anonymous string from the Name input box. I tried a theming function, I tried hook_form_alter() and hook_form_comment_form_alter(), too. I quickly resorted to Google, which only came up with exactly same solutions as I had tried:

function custom_changes_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id != 'comment_form')
  $form['comment_filter']['comment']['#rows'] = 5;
  $form['name']['#default_value'] = '';
  $form['name']['#required'] = TRUE;

It just didn't seem to work. I went through my code multiple times, I went through the Comment module code and didn't see where the value could be reset after I had cleared it.

Only when I switched off Javascript I realized a once submitted value gets stored in cookie and restored via script. Therefore, most of the solutions out there are correct, and if they don't seem to be working for you, make sure to remove the comment_info_name cookie.


“Cheap North Face Jackets is

“Cheap North Face Jackets is my love” reflect more and more young people like to wear North Face Jackets. Now North Face Outlet have many North Face Jackets On Sale. This is a good news to it’s fans. But Chicago Bulls Hats is the most amazing. Also Chicago Bulls Snapback Hats is a good choice.

I found the entire Software

I found the entire Software Tailor team to very helpful and knowledgeable.
You help me understand the differences between the other systems on the market
and the Software Tailor system.Please find

As we know, New Era Hats is

As we know, New Era Hats is the most popular hat in the recent years. Whatever NBA player or singer, they love wearing New Era Snapback Hats. Why they love Cheap New Era Hats? The reason is that New Era Hats Wholesale have high quality and low price. So it make people crazy!


[url=]Scarlet Blade Gold[/url] good

Not a <a

Not a <a href=""><strong>Miami Heats Snapback</strong></a> soul loves working with a baseball cover which doesn healthy properly, nonetheless many of the modern styles usually are not made to healthy all mind sizing's. Many men and women tend to be deciding on to put on any snapback cover, <a href=""><strong>Miami Heats Snapback Hats</strong></a> that was once famous in the 1980 which is returning in to style once more.<br>
Remember that <a href=""><strong>Miami Heat Hats</strong></a> 80, as soon as it was the many rage for everyone to obtain any snapback cover? For some reason, these kinds of baseball hats seemed to venture out connected with style, and various styles grew to become more popular. <a href="" title="Knit Hats"><strong>Knit Hats</strong></a> The only problem with the additional styles is the fact that numerous amounts usually are not adaptable. Several could possibly have Velcro straps, <a href=""><strong>NCAA Snapback Hats</strong></a> nonetheless most are any agony, curly hair becomes found within them, and they also add always remain, especially if they are elder hats. Additional hats have a very strap in addition to buckle, <a href=""><strong>Toronto Blue Jays Snapback Hats</strong></a> nonetheless once more, these kinds of are available loose, <a href=""><strong>NFL Snapback Hats</strong></a> which is any agony getting the small bit connected with strap standing, or maybe jammed in the ushanka in addition to feeling lumpy contrary to the mind. It really is probably for these reasons <a href=""><strong>Boston Red Sox Snapback Hats</strong></a> the fact that snapbacks tend to be back in design in addition to turning into very popular once more.<br>
A direct email marketing, <a href=""><strong>MLB Snapback Hats</strong></a> donning one of these brilliant hats offers almost nothing whatsoever to do with the power to adjust it or maybe that comfort and ease. It really is due to the fact they will really like <a href=""><strong>Boston Celtics Snapback Hats</strong></a> donning vintage clothes. This can be some thing which is extremely popular among lots of people, in addition to an increasing number of fashions in the 1980 tend to be returning in to style, which includes adaptable baseball hats. <a href=""><strong>NBA Snapback Hats</strong></a> A very important thing with regards to these kinds of hats is the fact that not just are they exciting to put on and a well put together fun time in the earlier, they are also highly cozy, and may end up being modified to suit pretty much any mind size.<br>
<a href=""><strong>NRL Snapback Hats</strong></a> Many of the hats which have been accessible in the earlier decade or maybe so only aren made to healthy all people. Positive, <a href=""><strong>Denver Nuggets Snapback Hats</strong></a> numerous amounts come in compact, choice in addition to big sizing's, nonetheless these kinds of sizing's add always work with all people, several <a href=""><strong>Obey Snapback Hats</strong></a> men and women only will get any cover which fits correct or maybe feels cozy. Which has a snapback cover, you can adjust that ushanka to any size you desire, in addition to not like additional styles of adaptable hats, <a href=""><strong>Cleveland Cavaliers Snapback Hats</strong></a> this will likely stay in the size you desire it to. You add have got to fiddle by using any straps or maybe Velcro, and also the ushanka will have a very cozy healthy.<br>
Snapbacks tend to <a href=""><strong>Supreme Snapback Hats</strong></a> be effortless to adjust, and they also never come apart, until eventually you consider them a part. To the backside in the ushanka, you will find there's compact cheap remove about every side. On the list of strips offers minor nubs about it, and also the additional offers divots. <a href=""><strong>The Hundreds Snapback Hats</strong></a> You simply find out which size is actually almost all cozy, then make in addition to place that nubs about one particular side in to the divots on the other hand. <a href=""><strong>Atlanta Braves Snapback Hats</strong></a> These kinds of hats tend to be good with regard to confident any smaller sized or maybe much larger mind, and may obtain built in hats to suit correct.<br>
You will <a href=""><strong>Ymcmb Snapback Hats</strong></a> discover an array of the reason why these kinds of hats tend to be returning in to popularity. Certainly, the biggest cause to put on any snapback cover is the fact that you can adjust it to any size you <a href=""><strong>Florida Marlins Snapback Hats</strong></a> desire, which is always gonna end up being cozy.<br>
At present that <a href=""><strong>DC Shoes Hats</strong></a> price ranges with regard to Miami housing get fallen and to buy a residence within Miami is often a worthwhile purchase. More than which Miami belongs to the greatest locations with regard to <a href=""><strong>Cleveland Indians Snapback Hats</strong></a> holiday season across the world.<br>
Miami <a href=""><strong>47 Brand Snapback Hats</strong></a> belongs to the most common in addition to famous locations with regard to holiday season. More than which, it really is a perfect spot to obtain another residence, wherever you can invest holiday season by using family and still have any relaxation.<br>
Right <a href=""><strong>Diamond Supply Co. Snapback Hats</strong></a> now to obtain residence within Miami is actually especially plan of action. To begin with lately that price ranges get fallen considerably and they are right now less expensive. <a href=""><strong>Atlanta Hawks Snapback Hats</strong></a> That mix off excellent Bradenton weather factors in addition to produced financial state connected with Miami makes this specific metropolis makes this specific <a href=""><strong>New York Yankees Snapback Hats</strong></a> metropolis highly interesting with regard to successful men and women from across the world.<br>
Should you have <a href=""><strong>Chicago Bulls Snapback Hats</strong></a> by now thought steps to make long-term investment funds in addition to assure your immediate future of one's youngsters in addition to grandchildren in addition to simultaneously not to lose any health issues in addition to vigor, Miami is actually excellent <a href=""><strong>Dallas Mavericks Snapback Hats</strong></a> choice available for you. In the event you choosed buy a residence within Miami you won't need to loose months of one's living thanks to awful wellbeing <a href=""><strong>Detroit Tigers Snapback Hats</strong></a> any longer also it can be an awesome next residence with regard to your family.

This is very educational

This is very educational content and written well for a change. It's nice to see that some people still understand how to write a quality post!

Paiguebeize <a

Paiguebeize <a href="">xaikalitag</a> Dessstink - iziananatt SIPHAGANNUAGO SonStypeJen

Paiguebeize <a

Paiguebeize <a href="">xaikalitag</a> Dessstink - iziananatt SIPHAGANNUAGO SonStypeJen

Another great post, I

Another great post, I appreciate all the work you put into this site, helping out others with your fun and creative works.

Thus, make sure that the

Thus, make sure that the garden is properly positioned in an area that has both sun and shade,
and that it has a nice little fence so that
animals cannot get into it. Floating Plants ' Appealing and Artistic: In addition to aquatic plants,
floating plants make for a very appealing and artistic water garden. First you must take care of the physical parts of the house, such as shape, size and color.

Hello,I love reading through

Hello,I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts. <a href=""></a>

thanks for sharing!very

thanks for sharing!very good!Please find

у нас на данном веб-портале

у нас на данном веб-портале можно почитать <a href=>о машинах</a>.

How about the lost history in

How about the lost history in all of those
issue you'll miss you say. Writer Garth Ennis and artist Steve Dillon kick ass
by having an examination of the American identity.
The remaining item responses were combined into one scale for every

Yep! drupal is best blogging

Yep! drupal is best blogging platform. I have experience on this platform and its fun to work on it!

here at the above web -site

here at the above web -site you will be able to see a large selection of unique news <a href=>chrome</a>

Thank you, I have recently

Thank you, I have recently been looking for information approximately this topic for a long time and yours is the best I have found out so far.

All this dishes looks really

All this dishes looks really delicious and also very nice presented on the table. Casanova has been a great chef specially italian food.

I believe that you recognize

I believe that you recognize how to construct people pay attention to what you
have to pronounce,particularly with a concern that’s so vital. I am pleased to
suggest this blog.Please find Software Outsourcing (go to

It seems too complex and

It seems too complex and extremely broad for me. I am looking forward for your next post, <a href="">fengshui</a>

Yep!!! The reason is that New

Yep!!! The reason is that New Era Hats Wholesale have high quality and low price. So it make people crazy! This is my point of view..

Hi my friend! I want to say

Hi my friend! I want to say that this post is amazing, great written and include almost all significant infos. I'd like to see more posts like this. - Huey