Forum: Ruby on Rails rails fckeditor plugin in 2 forms in a view page

Ecec81af7caddc8730eee285475df4da?d=identicon&s=25 ruby rails (rubyonrails)
on 2013-10-23 15:07
Hi,

I have a view page where there are 2 forms and each form have fckeditor
textarea. . SO initially both forms will be hidden on page load. When I
click on a link1, the form1 div will be shown and form2 will be hidden
and vice versa. But when I click on link1 the form1 div appears the 2
fck text editors(one for form1 and another for form2). Please help.
My form1 is given as below.I am using rails 2.3 version.

Form1

    <div id="forward-form" style="display:none;">
      <% form_for :reminder, :url=>{:id2 =>@new_reminder.id,
:action=>'forward_reminder'},:html=>{:multipart=>true} do |l| %>
          <div id="form">
            <%= error_messages_for :reminder %>
            <div class="label-field-pair">
              <label for="subject">Email Id</label>
              <div class="text-input-bg"><%= l.text_area :email,
:value=>'',:rows=>3,:cols=>5 %></div>
            </div>
            <div class="label-field-pair">
              <div class="text-area-bg"><%= fckeditor_textarea
:reminder, :body,:lang => I18n.locale,:langdir => (rtl? ? 'rtl' : 'ltr')
%>
              </div>
            </div>
            <div id="submit-button">
              <%=submit_tag "#{t('send')}", :class => 'button',
:disable_with => "#{t('please_wait')}" %>
            </div>
      <% end %>
      </div>
    </div>
============================
Form2


    <div id="reply-form" style="display:none;">
      <% form_for :reminder, :url=>{:id2 =>@new_reminder.id,
:action=>'reply_reminder'},:html=>{:multipart=>true} do |l| %>
          <div id="form">
            <%= error_messages_for :reminder %>
            <div class="label-field-pair">
              <label for="subject">Email Id</label>
              <div class="text-input-bg"><%= l.text_area :email,
:value=>'',:rows=>3,:cols=>5 %></div>
            </div>
            <div class="label-field-pair">
              <div class="text-area-bg"><%= fckeditor_textarea
:reminder, :body,:lang => I18n.locale,:langdir => (rtl? ? 'rtl' : 'ltr')
%>
              </div>
            </div>
            <div id="submit-button">
              <%=submit_tag "#{t('send')}", :class => 'button',
:disable_with => "#{t('please_wait')}" %>
            </div>
      <% end %>
      </div>
    </div>
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.