2016-11-27 52 views
0

我正在嘗試將W3 school's "Company" Bootstrap theme改編爲版本號爲www.peek.solutions的網站。如何使用Formspree與引導程序模板

主題帶有一個聯繫表單,它還沒有工作,我試圖使用Formspree來實現它。我的做法至今只是一直以「包」與action="https://formspree.io/[email protected]"method=POST以下含有具有<form>標籤表單域的一部分,該文件如下:

<form action="https://formspree.io/[email protected]" method="POST"> 
<div class="col-sm-7 slideanim"> 
    <div class="row"> 
    <div class="col-sm-6 form-group"> 
     <input class="form-control" id="name" name="name" placeholder="Name" type="text" required> 
    </div> 
    <div class="col-sm-6 form-group"> 
     <input class="form-control" id="email" name="email" placeholder="Email" type="email" required> 
    </div> 
    </div> 
    <textarea class="form-control" id="comments" name="comments" placeholder="Comment" rows="5"></textarea><br> 
    <div class="row"> 
    <div class="col-sm-12 form-group"> 
     <button class="btn btn-default pull-right" type="submit">Send</button> 
    </div> 
    </div> 
</div> 
</form> 

然而,這似乎並沒有工作:當我在字段中填寫一些測試值並按下「發送」,我沒有看到Formspree的默認確認頁面,也沒有收到給定地址的電子郵件(見下文)。

enter image description here

我怎樣才能解決這個代碼,以使Formspree工作?

回答

0

我設法通過遵循https://webdesign.tutsplus.com/tutorials/quick-tip-add-a-formspree-form-to-your-static-sites--cms-23870上的示例來使其工作。以下是更新的摘要:

<form id="contactform" action="//formspree.io/[email protected]" method="POST"> 
<div class="col-sm-7 slideanim"> 
    <div class="row"> 
    <div class="col-sm-6 form-group"> 
     <input class="form-control" id="name" name="name" placeholder="Name" type="text" required> 
    </div> 
    <div class="col-sm-6 form-group"> 
     <input class="form-control" id="email" name="_replyto" placeholder="Email" type="email" required> 
    </div> 
    </div> 
    <textarea class="form-control" id="comments" name="message" placeholder="Message" rows="5"></textarea><br> 
    <div class="row"> 
    <div class="col-sm-12 form-group"> 
     <button class="btn btn-default pull-right" type="submit">Send</button> 
    </div> 
    </div> 
</div> 
<input type="hidden" name="_next" value="//peek.solutions/confirmation.html" /> 
<input type="text" name="_gotcha" style="display:none" /> 
</form> 

我仍然有得到_next輸入重新定向到我自己的確認頁面,而不是Formspree的默認的一些問題,但是這是一個單獨的問題。

相關問題