title: alter "required" property of the form element in drupal 7
body: <p>I have some require fields in some form,I want them  be required in somewhere and in another place not be required (I want exactly them , maybe you suggest me use existance field in cck but this  fields not in cck.)
  I used profile2 module with some profile type, I want in profile type edit page as example <code>name</code> field be required and in user registration <code>name</code> field not be required.
  I try to alter <code>#require</code> property of <code>name</code> field in form alter, it's changed correctly  but in validation tell me the <code>name</code> field is required.</p>
  
  <p>in   </p>
  
  <pre><code>      function mymodule_form_alter(&amp;$form,&amp;$form_state) {
              if ($form_id == 'user_register_form') {
                $form['profile_detailp']['field_name']['und']['#required']=0;
                ...
                }
  
        }
  </code></pre>
  
  <p>any idea ?</p>