English 中文(简体)
jj 铁路应用中的查询表输入
原标题:jQuery table input in rails app

在我的应用程序里,我有一个有4个字段的表格,记录一个朋友的信息。 (见截图)

在底部,我有一个按钮,如果用户想要输入另一个记录,该按钮会动态复制窗体。

如果用户想要添加大量记录, 时间会非常长。

有没有更干净的方法?

""https://i.sstatic.net/xZFU1.png" alt="此处输入图像描述"/"

视图代码 :

<div id="single_module">
<div class="pitch">
<h2>Step 3: Friends Birthdays</h2>
</div>
<form id="myForm">
<div id="input1" style="margin-bottom:4px;" class="clonedInput">
<%= simple_form_for @user, url: wizard_path do |f| %>

  <div class="inputs">
  <ul class="testss1">
  <%= f.simple_fields_for :friends do |friend_f| %>
    <li>
    <%= friend_f.input :name %>
    </li>
    <li>
    <%= friend_f.input :dob, :as => :date_picker, :label =>  Birthday , :input_html => { :class =>  special  } %>
    <li>
    <%= friend_f.input :gender, :collection => [ male , female ] %></li>
    </li><li>
    <%= friend_f.association :interests, :as => :select, :label => false %></li>


    <%end%>

    </div>
    <div>
    <input type="button" id="btnAdd" value="add another name" />
    <input type="button" id="btnDel" value="remove name" />
    </div>
    </form>
    <div class="actions">
    <%= f.button :submit,  Next Step , :class =>  btn btn-primary ,  %>
    <br></br>
    </div>
    <%end%>
问题回答

每次完成时, 您是否保存, 添加另一个朋友单击? 为什么即使在临时隐藏字段中不保存您的数据, 然后以您的形式清除所有数据, 让用户添加另一个记录?





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签