• Resolved finar76

    (@finar76)


    Hello,

    I am trying to build a Mailchimp Form with “MailChimp for WP”…

    I would like to have few fields already filled in if the user is already logged-in into my website.

    For example in the code below I would like to “pre-fill” UserId and email of the logged in user…

    how do I do that?

    Many thanks

    Ivan

    <p>
        <label>UserName</label>
        <input name="USERID" type="text" >
    </p>
    <p>
        <label>Email Address</label>
        <input name="EMAIL" required="" type="email" >
    </p>
    <p>
        <label>Name</label>
        <input name="FNAME" type="text">
    </p>
    <p>
        <label>Surname</label>
        <input name="LNAME" type="text">
    </p>
    <p>
        <input type="submit" value="Invia">
    </p>

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello,

    On the form editing screen, we offer variables that you can add to the value of a field. Please find an example form code that you can use for your website.

    <p>
    	<label>Email address: </label>
    	<input type="email" name="EMAIL" placeholder="Your email address" value="{user property='user_email'}" required />
    </p>
    <p>
        <label>UserName</label>
        <input type="text" name="UNAME" value="{user property='user_login'}">
    </p>
    <p>
        <label>First Name</label>
        <input type="text" name="FNAME" value="{user property='user_firstname'}">
    </p>
    <p>
        <label>Last Name</label>
        <input type="text" name="LNAME" value="{user property='user_lastname'}">
    </p>
    <p>
    	<input type="submit" value="Sign up" />
    </p>

    Please note this will retrieve the username and not the ID.

    Thread Starter finar76

    (@finar76)

    GREAT! it worked well!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to default forms based on logged-in user’ is closed to new replies.