Grab WordPress username and populate it to the form

  • Profile Image
    JohnReaves
    Asked on June 19, 2014 at 03: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!

  • Profile Image
    EltonCris
    Answered on June 19, 2014 at 03:04 PM

    The workaround is still fresh and working. :)

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

    Regards!

  • Profile Image
    JohnReaves
    Answered on June 25, 2014 at 07:30 PM

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

  • Profile Image
    RickScavetta
    Answered on August 30, 2014 at 08: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>

     

     

     

  • Profile Image
    RickScavetta
    Answered on August 30, 2014 at 08:52 AM

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