Pre-populating Wix Logged in Member Details onto an embedded Jotform

Velo code runs on your Wix site page, not inside embedded HTML iFrames. Hence you canot combine the two.

Just simply follow these steps:

  • Add the Embed a Site element on you members only page where you want this form to be.

  • Then place your Jotform URL (https://form.jotform.com/250547430501851) in the website address field and click on Update.

  • Now turn on Dev Mode (beside the Wix logo at the very top of the editor). You should see a code panel pop up below.

  • Clear all the code inside that code panel and replace it with the following:

    import { currentMember } from "wix-members-frontend";
    
    $w.onReady(function () {
        currentMember
            .getMember()
            .then((member) => {
    
                const fullName = `${member.contactDetails.firstName} ${member.contactDetails.lastName}`;
    
                $w('#html1').src = $w('#html1').src + "?memberName=" + fullName + "&memberEmail=" + member.loginEmail
    
            });
    });
    
  • Make sure there are no red lines in the code and finally Publish the site.

Test it out and once it is working as expected, you can turn off Dev Mode and the code will continue to function.

Points to note:

  • Make sure that the ID of your Embed element is #html1. You can do this by clicking on the HTML Embed element with the Dev Mode on. You will be able to see the ID of the selected element right beside the code panel at the bottom.
  • The page will need to be set to Members Only in order for the code to work correctly.
  • You can add as many fields as you want by building upon the following syntax:
    + "&fieldName=" + fieldValue