0

我有一个 mailchimp 表单,我需要在我的网站上填充来自简单 html 表单的内容。

我在 mailchimp文档中读到,这很可能通过将查询变量附加到 url 来实现。

所以我需要这样的东西:

http://mb30.us7.list-manage1.com/subscribe/post?u=e0bf770a88286aad599b3e945&id=f3cc462828&MERGE1=name&MERGE2=June%205th%20-%208pm%20EST/5pm%20PST&MERGE0=mail

我需要从下面的表格中获取上面的 url:

<form action="http://mb30.us7.list-manage1.com/subscribe/post?u=e0bf770a88286aad599b3e945&amp;id=f3cc462828" method="post" name="" target="_blank" novalidate="">
      <h5>1. Which day do you want to attend?</h5>
      <select name="time" style="display: none;">
            <option value="May_20th_-_8pm_EST/5pm_PST">May 20th - 8pm EST/5pm PST</option>
            <option value="May_25th_-_8pm_EST/5pm_PST">May 25th - 8pm EST/5pm PST</option>
            <option value="May_29th_-_8pm_EST/5pm_PST">May 29th - 8pm EST/5pm PST</option>

      </select><div class="ddContainer" style="position:relative;"><a href="#" class="ddToggle" style="width: 200px;">May 20th - 8pm EST/5pm PST<span></span></a><ul class="ddOptionList" style="display: none; top: 48px; width: 223px;"><li class="ddOption"><a class="selected" href="#" rel="May_20th_-_8pm_EST/5pm_PST" style="padding-left: 4px;">May 20th - 8pm EST/5pm PST</a></li><li class="ddOption"><a class="" href="#" rel="May_25th_-_8pm_EST/5pm_PST" style="padding-left: 4px;">May 25th - 8pm EST/5pm PST</a></li><li class="ddOption"><a class="" href="#" rel="May_29th_-_8pm_EST/5pm_PST" style="padding-left: 4px;">May 29th - 8pm EST/5pm PST</a></li></ul></div>

      <h5>2. Where to send the invitation:</h5>
      <input type="text" class="inputbg" onfocus="if (this.value == 'Your Name') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Your Name';}" value="Your Name">
      <input type="email" name="EMAIL" class="inputbg" onfocus="if (this.value == 'Your Email Address') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Your Email Address';}" value="Your Email Address">
      <input type="submit" class="submit" value="Register">
</form>

但是,如果我更改表格以获取,则我无法使其正常工作,而不是要求 u= 和 id= 被删除。

4

1 回答 1

1

不要将值添加到 URL,而是<input>为这些值创建 hidden 。这也是这个例子所做的(查看源代码)。

<input type="hidden" name="u" value="e0bf770a88286aad599b3e945" />
<input type="hidden" name="id" value="f3cc462828" />
于 2013-05-16T19:45:10.857 回答