Grab WordPress username and populate it to the form

  • JohnReaves
    Asked on June 19, 2014 at 3:04 PM

    Original thread http://www.jotform.com/answers/357275

    This is exactly something I need to do.  Hopefully this thread is still active; I'll try to implement this over the next week or so.  Thanks!

  • Elton Support Team Lead
    Replied on June 19, 2014 at 3:04 PM

    The workaround is still fresh and working. :)

    If you come across any issues, feel free to let us know here.

    Regards!

  • JohnReaves
    Replied on June 25, 2014 at 7:30 PM

    Thanks, got it up and running ... works great!

  • RickScavetta
    Replied on August 30, 2014 at 8:43 AM

    This is wonderful. I got this working for one field. Can you give an example of how we can auto-fill multiple fields in this way?

    Thanks!!

     

    example:

     

    <script type="text/javascript" src="//form.jotformeu.com/jsform/XXXXXXX?username=[insert_php] global $current_user; get_currentuserinfo(); echo $current_user->user_login;[/insert_php]"></script>

    works great. The following does not (I tried to combine with &):

    <script type="text/javascript" src="//form.jotformeu.com/jsform/XXXXXXX?username=[insert_php] global $current_user; get_currentuserinfo(); echo $current_user->user_login;[/insert_php]emailAddress=[insert_php]&global $current_user; get_currentuserinfo(); echo $current_user->user_email;[/insert_php]"></script>

     

     

     

  • RickScavetta
    Replied on August 30, 2014 at 8:52 AM

    oh, forget about that. the & was in the wrong position. Everything fixed now.