2014-01-23 162 views
0

嘗試使用第三方表單解決問題,但不幸必須使用iframe將其嵌入到文章內容中。當用戶提交他們的電子郵件地址時,感謝頁面將在iframe佔用的空間中打開,而不是在頁面/新窗口中打開。我試着用下面的JS腳本無濟於事:IFrame表單提交在框架中打開,需要在新窗口中打開

<script type="text/javascript"> 
// If "&_parent=URL" is in this page's URL, then put URL into the top window 
var match = /_parent=(.+)/.exec(window.location.href); 
if (match != null) { 
top.location = match[1]; 
} 
</script> 

有問題的網頁:

http://restoringqualityoflifeblog.org/subscribe/

謝謝!

+0

這是非常艱難的編輯什麼的iframe本身的內部發生。查看錶單本身如何提交給服務器,並用你自己的表單模仿它可能會更容易 – Chizzle

回答

0

https://help.salsalabs.com/entries/21689130-Embed-a-signup-form 這裏是您需要的表單,它自己用[]指示您需要的鍵來工作。

<form action="[[API URL]]/save" method="POST"> 
    <input type="hidden" name="organization_KEY" value="5881"/> 
    <input type="hidden" name="chapter_KEY" value="887"/> 
    <input type="hidden" name="email_trigger_KEYS" value="12644,12656"/> 
    <input type="hidden" name="object" value="supporter"/> 
    <label for="first_name">First Name:</label><input type="text" id="first_name" name="First_Name"/></br> 
    <label for="last_name">Last Name:</label><input type="text" id="last_name" name="Last_Name"/></br> 
    <label for="email">Email:</label><input type="text" id="email" name="Email"/></br> 
    <style>.memberCode{display:none;}</style> 
    <div class="memberCode"> Optional Member Code <input name="first_name_949" value=""/></div> 
    <input type="hidden" name="link" value="groups"/> 
    <input type="hidden" name="linkKey" value="11"/> 
    <input type="hidden" name="link" value="groups"/> 
    <input type="hidden" name="linkKey" value="12"/> 
    <input type="hidden" name="link" value="groups"/> 
    <input type="hidden" name="linkKey" value="13"/> 
    <input type="hidden" name="tag" value="excellent"/> 
    <input type="hidden" name="redirect" value="http://YOUR URL"> 
    <input type="Submit" value="Sign up" /> 
</form> 

您已經填寫表格的工作副本: http://salsa3.salsalabs.com/o/50047/p/salsa/web/common/public/signup?signup_page_KEY=8896

+0

我想我可以從工作副本(第二個URL)獲取代碼並將其添加到文章中,但是當我做它重定向到莎莎頁面託管的形式。 (第二次提交表格)他們非常堅持使用IFrame - 令人沮喪。 – plloyd

+0

試着看看第一個鏈接。它確實看起來像允許你在頁面上將它設置爲你自己的形式。 – Chizzle

+0

這也可能有用:http://www.richiroutreach.com/blog/how-embed-salsa-sign-form-your-wordpress-page – Chizzle