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

javascript passing in default value


  1. aes
    Member

    Hi, I had read that I can pass in default values like so:

    <script type="text/javascript">
    var __machform_url = 'http://xyz.com/advisor2/machform/embed.php?id=11318?element_270=1';
    var __machform_height = 19582;
    </script>
    <div id="mf_placeholder"></div>
    <script type="text/javascript" src="http://xyz.com/advisor2/machform/js/jquery.min.js"></script>
    <script type="text/javascript" src="http://xyz.com/advisor2/machform/js/jquery.ba-postmessage.min.js"></script>
    <script type="text/javascript" src="http://xyz.com/advisor2/machform/js/machform_loader.js"></script>

    note the ?element_270=1 added to the url.

    I am not seeing the value being set in my form.I have double checked that element_270 is the one I am after.

    This leads to what I really want to do though. I want to have a COOKIE be the value being passed in. Will that work?

    ie

    function getCookie(cname)
    {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for(var i=0; i<ca.length; i++)
    {
    var c = ca[i].trim();
    if (c.indexOf(name)==0) return c.substring(name.length,c.length);
    }
    return "";
    }

    ?element_270='+getCookie("uid")

    Posted 10 years ago #
  2. aes
    Member

    Never mind, the issues was the second ? should have been a &

    Posted 10 years ago #

RSS feed for this topic

Reply