簡體   English   中英

Facebook App表單不會提交

[英]Facebook App form won't submit

好的,所以我有在網站上使用的此電子郵件注冊表格。 我直接從電子郵件管理系統獲得了腳本,因為它們是處理表單的腳本。

我正在我的網站上使用它,並且效果很好,但是當我嘗試在Facebook App中運行相同的腳本時,它無法提交。 實際上,這並不是嚴格意義上的,因為如果未選中,它會彈出“您需要同意條款...”,但除此之外別無所求。

我已經在瀏覽器中對其進行了測試,並且可以正常工作,所以我知道代碼沒有什么問題,我對為什么它無法在Facebook中運行感到困惑。

以下是該腳本在頁面上的確切顯示方式。

<form action="http://www.elabs12.com/functions/mailing_list.html" method="post" name="UPTml807" onSubmit="return (!(UPTvalidateform(document.UPTml807)));">
        <input type="hidden" name="submitaction" value="3">
        <input type="hidden" name="mlid" value="807">
        <input type="hidden" name="siteid" value="2012000210">
        <input type="hidden" name="tagtype" value="q2">
        <input type="hidden" name="demographics" value="1,2,-1,40836,37592">
        <input type="hidden" name="redirection" value="http://www.MYWEBISTE.com/WebContent/Promotions/PromotionsNewEmailThanks.htm">
        <input type="hidden" name="uredirection" value="http://">
        <input type="hidden" name="welcome" value="">
        <input type="hidden" name="double_optin" value="">
        <input type="hidden" name="append" value="on">
        <input type="hidden" name="update" value="on">
        <input type="hidden" name="activity" value="submit">

        <div class="textfield">
        <table border="0" cellspacing="0" cellpadding="5" width="100%">
  <tr>
    <td><span class="formText">Your First Name*</span><br/><input type="text" name="val_1" class="firstName" size="10" value="" /></td>
    <td><span class="formText">Your Last Name*</span><br/><input type="text" name="val_2" class="lastName" size="10" value="" /></td>
  </tr>
  <tr>
    <td colspan="2"><span class="formText">Your Email*</span><br/><input type='text' name='email' class="email" value=''  style='display:block'/></td>
    </tr>
  <tr>
    <td colspan="2"><span class="formText">Your Mobile Number</span><br/>
      <input type='text' name='val_3' class="mobile" value=''  style='display:block'/></td>
    </tr>
  <tr>
    <td><div style="text-align:left; margin:0 0 20px 0px"><input type="checkbox" id="val_37592" name="val_37592" style="width:20px; height:10px;">  
<span class="formText">I accept your Privacy Policy (below)*</span><br/><br/><span style="font-size:12px !important;" class="formText">*Required field</span></div></td>
    <td align="right"><input type="submit" name="submit" value="Submit" class="submitBTN" /></td>
  </tr>
</table>


</div>



<script language="Javascript">
function emailCheck (emailStr) {
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
    alert("Email address seems incorrect (check @ and .'s)");
    return false;
}
var user=matchArray[1];
var domain=matchArray[2];
if (user.match(userPat)==null) {
    alert("The username doesn't seem to be valid.");
    return false;
}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
      for (var i=1;i<=4;i++) {
        if (IPArray[i]>255) {
            alert("Destination IP address is invalid!");
        return false;
        }
    }
    return true;
}
var domainArray=domain.match(domainPat);
if (domainArray==null) {
    alert("The domain name doesn't seem to be valid.");
    return false;
}
var atomPat=new RegExp(atom,"g");
var domArr=domain.match(atomPat);
var len=domArr.length;
if ((domArr[domArr.length-1] != "info") &&
    (domArr[domArr.length-1] != "name") &&
    (domArr[domArr.length-1] != "arpa") &&
    (domArr[domArr.length-1] != "coop") &&
    (domArr[domArr.length-1] != "aero")) {
        if (domArr[domArr.length-1].length<2 ||
            domArr[domArr.length-1].length>3) {
                alert("The address must end in a three-letter domain, or two letter country.");
                return false;
        }
}
if (len<2) {
   var errStr="This address is missing a hostname!";
   alert(errStr);
   return false;
}
return true;
}
function UPTvalidateform(thisform)
{
if (document.getElementById("val_37592").checked==false){alert("Please let us know you have read and agree to the Terms and Conditions of this email alert sign up"); return(true);}

if (thisform.val_1.value==""){   
alert("Please enter a value for First Name");
return(true);}if (thisform.val_2.value==""){   
alert("Please enter a value for Last Name");
return(true);}
    if (emailCheck(thisform.email.value)) 
    {   

        if ((document.getElementById('unsubscribe') 
            && document.getElementById('unsubscribe').checked) && (document.getElementById('showpopup') && document.getElementById('showpopup').value == "on")) {
        alert('Thank you, now you are unsubscribed!'); 
    }
    else if(( (document.getElementById('unsubscribe')
            && !document.getElementById('unsubscribe').checked) || (!document.getElementById('unsubscribe')) ) && (document.getElementById('showpopup') && document.getElementById('showpopup').value == "on")){
            alert('Thank you for signing up!');
        }
        return false;
    }
    else
    {
        return true;
    }
}

</script>

    </form>

我嘗試刪除JS,以查看Facebook是否阻止了它,但我得到的結果還是一樣。 我什至嘗試提交到其他URL,但是沒有運氣。

有什么我想念的東西/我是盲人嗎? 也許這是一個更深層次的問題...

任何幫助深表感謝。

謝謝。

您提交的網址必須在應用程序詳細信息中注冊。 嘗試在Facebook開發人員中更改應用程序域。

此外,如果您以安全模式(默認設置)瀏覽Facebook,它將阻止來自非SSL網址的所有內容。 因此http://www.elabs12.com/functions/mailing_list.html必須是https://www.elabs12.com/functions/mailing_list.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM