remove unwanted form elements
Remove unwanted form elements (example: removing Your name: <username> from comment forms)
These code snippets illustrate how to unset (remove) any undesired form element from a specific form. If you don't want to only remove elements from a form, you can also alter existing values or add new elements to a form using these methods. The example in this lesson uses the Comment form, removing the Your name: <username> (which appears only to logged in users) as well as the title above the textarea of the form. There are two ways you can accomplish this, either using hook_theme() in your template.php, or using hook_form_alter() in a custom module. Both methods are very useful, and you will learn a lot by attempting both.
Using hook_theme() in template.php
Instead of this lesson repeating already existing (and excellent) information, instead please see Using hook_theme() to modify forms and Lullabot: modifying forms. Below is the code for this particular example. Add the following code snippet to your template.php file. Replace MYTHEME with the name of your own theme (e.g. garland) and clear the theme registry after adding the code (see Administer > Site configuration > Performance). Do not include the opening and closing php tags.
<?php
/**
