This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

pass info through a form hidden field?


  1. spatafore
    Member

    hi, Im using expression engine (cms) and I create a form with machform, I need fill automatically one filel of the name and last name of the users

    {exp:member:custom_profile_data}{username}{/exp:member:custom_profile_data}

    that code render: John Doe by example, so I need auto fill that in a normal text field of my machform field.

    you go it? the idea is pass values and putting hidden,

    you know If Im login in the cms, and go to contact form, just fill the subject and message, the name and last name are auto filled, of that way I receive the form knowing which member send me a message.

    please help, thanks

    Posted 11 years ago #
  2. yuniar

    Using this method:
    http://www.appnitro.com/doc-url-parameters

    You can dynamically generate the form embed code to pass the data from your cms.
    Assuming you are using the Javascript code to embed the form. The code would be something like this

    <script type="text/javascript">
    var __machform_url = 'http://www.example.com/machform/embed.php?id=12755&element_1={exp:member:custom_profile_data}{username}{/exp:member:custom_profile_data}';
    var __machform_height = 479;
    </script>
    <div id="mf_placeholder"></div>
    <script type="text/javascript" src="http://www.example.com/machform/js/jquery.min.js"></script>
    <script type="text/javascript" src="http://www.example.com/machform/js/jquery.ba-postmessage.min.js"></script>
    <script type="text/javascript" src="http://www.example.com/machform/js/machform_loader.js"></script>

    if the above code doesn't looks good here, here is another link:
    https://gist.github.com/anonymous/74f9692c74cf0d7621c7


    MachForm Founder

    Posted 11 years ago #

RSS feed for this topic

Reply