How to display current user name in webform field? I have created one webform with Name,Email id, Address fields.
if user is login in name field already fill with 'login user name' and no one login then its fill with 'Anonymous'.

my issue is if user login its fill with login user name but not login then filed should be blank not fill with 'anonymous'.

Please help...
You can alter the webform and put some and achieve this.

&lt;?php 
    function module_name_form_alter(&amp;$form, &amp;$form_state, $form_id) {   
   // module_name = your custom module name.
       if($form_id =='webform_name')
        // webform_name = your webform id
           //check condition for non login user
           if(!user_is_logged_in()){
            {           
             $form['submitted']['field_name']['#default_value']= 'anynomous';  
             // field_name = Field name        
            }
         }
    }

    ?&gt;


You also need to debug using dpm. Which helps you solve you problem easily.

I believe that you can also do this using Rules module. You also need to try for this.