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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:17:52+00:00 2026-06-14T10:17:52+00:00

I have two buttons where one button i.e Staffing and another button i.e NonStaffing

  • 0

I have two buttons where one button i.e Staffing and another button i.e NonStaffing. When I click on the Staffing button then I’m able to get my desired result, meaning I’m able to see page1 and hide page2. But when I click on the NonStaffing button then I’m not getting my desired result, meaning hiding page1 and showing page2. It hides the whole page. I’m not able to figure out the problem.

HTML:

<ul>
     <li class="menu-item" style="list-style-type: none;margin-left: 50px; margin-top: -120px; position: absolute;">
        <input   type="submit" name="projectType" value="Staffing" >
     </li>
    <li style="list-style-type: none;margin-left: 150px; margin-top: -120px; position: absolute;" >
        <input type="submit" name="projectType1" value="NonStaffing">
    </li>
</ul>


<div id="abc1" style="background: #CCC; height:250px;width:250px;margin-top:150px;border: 4px solid #AAA;">
   <button>Open Dialog</button>
        Page1  

</div>


<div id ="mno" style="background: #CCC; height:110px;width:150px;margin-left:410px;margin-top: -250px; border: 4px solid #AAA;"> Page2

</div>

Javascript:

var dialogOffset = {
    top: 50,
    left: 10
}
  $("input:submit[name=projectType1]").click(function() {
    var value = $(this).val();
    if(value=='NonStaffing'){

        $('#mno').show();
         $('#abc1').hide();


    }else{


    }
});



     $("input:submit[name=projectType]").click(function() {
                var value = $(this).val();
                    if(value=='Staffing'){
                        $('#abc1').show();
                        $('#mno').hide();
                    }else{}
                }); 



$('button').click(function() {
    var $parent = $(this).closest('div.col');
    var parentPos = $parent.offset()
    var parentIndex = $('.col').index($parent);   
    var numDialogs= $('.colDialog_'+parentIndex).length;
    var dialogTop=parentPos.top + dialogOffset.top + numDialogs*30;
    var dialogPosition = [parentPos.left + dialogOffset.left, dialogTop];
    $('<div class="colDialog_'+parentIndex+'">').dialog({      
        position:  dialogPosition,
        width: 170,
        title: 'Col:'+(parentIndex+1 +', Dia: '+(numDialogs+1)) ,
        close: function() {
            $(this).remove()
        }
    })
});​

And you can find a JSFiddle of the code above here.

  • 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-14T10:17:54+00:00Added an answer on June 14, 2026 at 10:17 am
    <input type="submit" class="chgpage" rel="abc1" value="Staffing" >
    <input type="submit" class="chgpage" rel="mno" value="NonStaffing">
    <div id="abc1" class="page" style="display:none;width:500px;height:500px;border:1px solid black;">Page1</div>
    <div id ="mno" class="page" style="display:none;width:500px;height:500px;border:1px solid red;">Page2</div>
    
    
    <script type="text/javascript">
         $("input.chgpage").click(function() {
             $('div.page').hide();
             $('#'+$(this).attr('rel')).show();
        });
    </script>
    

    Have Fun 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two buttons, one of class button white and another one of class
In Application i have two buttons in which one button is used as a
I have a page with two buttons, one Button opens a popup window with
I have two buttons, one for start recording and another for stop recording. i
I have created an activity with two buttons at the top. One button to
On my form I have a IWTreeView and two buttons. One button deletes some
I have two buttons and two divs(I put one above another). I made info
In my application screen, i have two buttons. one is Activate and another is
Everybody.. How to set animation on button click ? I have two buttons, both
I have two buttons on my application. One button starts a new Game (lets

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.