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
I have just a basic html form within index.php which contains two text fields:
I have some markup for a set of fields within a form: <ul> <li>
I am using a windows form and within the form i have a user
I have a Portlet that contains a form. Now what I want to achieve
I have a partial that contains a form: <% form_for :message, :url => {
I'm trying to create a web form that contains checkboxes, among other input elements,
I have 25 products showing in a page. Each product contains a form within
I have a Form that contains only 2 things, a PictureBox and a Label
I have a zone that contains a form that contains a loop. When someone

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.