LeadiD_token get the value

LeadiD_token get the value

本文关键字:the value get token LeadiD      更新时间:2023-09-26

我有一个webform和我的leadid_token是从Jornaya生成的。这里有一个脚本代码,我们刚刚放到了我的网页上。我的问题是我想把令牌的价值发布到我的门户网站cms,我们该怎么做这例:

<form method="post" action="https://portalcmssample.php" id="form1">
    <input id=" leadid_token " name="universal_leadid" type="hidden" value= "" /></div>
</form>

我没有看到令牌的值在我提交后出现在我的cms门户吗?我做错什么了吗?

老问题,答案很简单。我们使用下面的解决方案,它利用了jQuery。确保在脚本中包含了jQuery,然后在

后面包含以下代码:
<script type="text/javascript">
  $(document).ready(function () {
  if (!$('#leadid_token').length) {
    $('form').last().append(
      $('<input>').attr({
        type: 'hidden',
        id: 'leadid_token',
        name: 'LeadiDToken'
      }));
  }});
</script>
<script id="LeadiDscript" type="text/javascript">
    // Your Jornaya script goes here
</script>

这段代码将自动向表单添加一个隐藏字段。Jornaya的脚本将在加载async后自动填充这个表单的值。该值将在提交表单时提交给服务器。