在显示结果页面

时间:2017-08-15 15:28:34

标签: javascript jquery ruby-on-rails forms pipedrive-api

我希望在向我的客户展示我的结果页面之前显示来自API的JS表单,

我尝试在模态或弹出窗口中显示表单,但是它的API来自API,所以当我点击提交按钮时,我无法控制关闭它,这样每次启动时都会显示表单搜索,我想在我的主页第一次搜索时单次显示它,所以我想我必须在我的结果页面之前运行它

我试图在搜索结果之前渲染一个新页面,但是如果我这样做的话,我会松开搜索参数

简化: 首页搜索主页 - > API Pipedrive表单 - >结果页面

我的搜索栏

<%= form_tag resultat_path, id: "address_input", method: :get, autocomplete: 'on' do %>
  <%= text_field_tag :location, params[:location], {id: 'address', class: "namanyay-search-box", placeholder: '10 rue Nationale Lille', :required => true} %>
  <%= select_tag(:room_type, options_for_select([ ['Maison', "Maison"], ['Appartement', "Appartement"], ['Terrain', "Terrain"], ['Local Commercial', "Local_Commercial"], ['Immeuble de rapport', "Immeuble_de_rapport"], ['Murs commerciaux', "Murs_commerciaux"], ['Fond de commerce', "Fond_de_commerce"]]),
   {class: "namanyay-search-box-type", :prompt => "Type de bien", :required => true})  %>
  <%= select_tag(:nb_piece, options_for_select([['0', "0"], ['1', "1"], ['2', "2"], ['3', "3"], ['4', "4"], ['5 et +', "5 et +"]]),
   {class: "namanyay-search-box-room", :prompt => "Nombre de pièces", :required => true}) %>
  <%= submit_tag "Find !", id: "namanyay-search-btn" %>
<% end %>

我的JS表格

<div class="pipedriveWebForms" data-pd-webforms="https://pipedrivewebforms.com/form/f5cd01e9418f0b683195eb0e821770181945719">
        <script src="https://pipedrivewebforms.com/webforms.min.js"></script>
      </div>

0 个答案:

没有答案