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 8346709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:06:28+00:00 2026-06-09T07:06:28+00:00

I have a contact form that I’m trying to show/hide div’s and a class

  • 0

I have a contact form that I’m trying to show/hide div’s and a class “open” to the clicked on tab.
It’s very basic, the user will click on either “Business request” or “Have a question?”.

When the contact form is first viewed by default “Business request” is displayed “open”. Clicking on “Have a question” will hide some div’s from the page.

<div class="contact_tab_container">
<div class="contact_tab business_request open">
  <p>Business request</p>
  <span>
  <p>Let’s work together!</p>
  </span> </div>
<div class="contact_tab have_a_question">
  <p>Have a question?</p>
  <span>
  <p>Ask us anything or just say Hi</p>
  </span> </div>

I want to add the class “open” when either is clicked and hide the following div’s when the “have_a_question” div is clicked: .contact_additional, .contact_budget, .attach_files

These div’s are displayed again when the “business_request” div is clicked.

Any ideas on how I can do this?

$(window).load(function() {
$('.have_a_question').toggle(function() {
$(this).addClass('open');
$('.business_request').removeClass('open');
return false;
},
function() {
$('.have_a_question').toggle(function() {
$(this).addClass('open');
$('.business_request').removeClass('open');
return false;
});
}); 
}); 
  • 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-06-09T07:06:33+00:00Added an answer on June 9, 2026 at 7:06 am

    I think this will solve your problem.

    $('.contact_tab_container').on('click', '.contact_tab', function(e){
        var target = $(e.currentTarget).addClass('open');
        target.siblings('.contact_tab').removeClass('open');
    
        if(target.is('.business_request ')){
            $('.contact_additional').show();
            $('.contact_budget').show();
            $('.attach_files').show();
        }else{
            $('.contact_additional').hide();
            $('.contact_budget').hide();
            $('.attach_files').hide();
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all, I have a basic HTML contact form that goes to a .php
I have a basic PHP form here that sends an email when submitted: <div
I have an entity form customization that adds an extra tab to my Contact
I have a small demo contact form that I'm trying to build using Ajax.
I have a contact form that can be hidden using .slideToggle() but I want
I have a contact us form that uses Ajax (i.e. relies on asynchronous requests).
i have a PHP contact form that submits data, and an email...: <?php $dbh=mysql_connect
I have an Ajax contact form that links to a jquery file but for
i have bought a template that have built in contact form problem is that
I have a simple contact form with Subject and Message that I want to

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.