Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4101280
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:40:35+00:00 2026-05-20T20:40:35+00:00

I have a within a form that contains other fields for the form. I

  • 0

I have a within a form that contains other fields for the form. I would like the User to be able to toggle whether they see it or not.

I would like them to be able to press a button/link which would make that div appears or disappear. Ideally I could have some simple javascript effect, such slide in or fade-in.

Here is my _form:

  1 <%= form_for @message do |f| %>
  2   <%= f.error_messages %>
  3   <p>
  4     <%= f.label :subject %><br />
  5     <%= f.text_field :subject %>
  6   </p>
  7   <p>
  8     <%= f.label :body %><br />
  9     <%= f.text_area :body %>
 10   </p>
 11   <p>
 12   <div id = "contact_form">
 13      <%= form_for @contact do |fc| %>
 14         <p>
 15           <%= fc.label :first_name %><br />
 16           <%= fc.text_field :first_name %>
 17         </p>
 18         <p>
 19           <%= fc.label :last_name %><br />
 20           <%= fc.text_field :last_name %>
 21         </p>
 22 
 23      <% end %>
 24   </div>
 25   </p>
 26   <p>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:40:36+00:00Added an answer on May 20, 2026 at 8:40 pm

    The easiest way to do this would be to use the .css rule of the jQuery javascript library:

    http://api.jquery.com/css/
    (See the example about a quarter down: To change the color of any paragraph to red on mouseover event.)

    So using this you’d use this javascript on clicking the button/link:

    $('div#contact_form').css('display', 'none');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web form that contains a usercontrol and I would like to
Within my Subversion project I have a few directories that contain other open source
Within a form I have a user control for each field being returned. The
I have a need to close a parent form from within child form from
Is it possible to embed a windows form within another windows form? I have
I have this form: <form name=customize> Only show results within <select name=distance id=slct_distance> <option>25</option>
Say I have a Textbox nested within a TabControl . When the form loads,
I have a TabControl within a TabControl. I want the outer TabControl to show
I have Aptana installed within Eclipse. I'm working on a project with the dojo
Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources: <asp:FormView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.