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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:06:25+00:00 2026-05-25T12:06:25+00:00

I have a problem. I have two HTML buttons, and I want to show

  • 0

I have a problem. I have two HTML buttons, and I want to show one at one time. I have code which is working fine but the problem is of space. In the GUI, spaces of both buttons are present which is not acceptable. I want to place both buttons on the same location.

The code is:

function searchWithin(id)
{
    if(document.getElementById("searchwithin").checked)
     {
     document.getElementById('searchwithin_'+id+'_searchButton').style.visibility="visible";
     document.getElementById(id+'-form-submit').style.visibility="hidden";
     }
     else
     {
         document.getElementById('searchwithin_'+id+'_searchButton').style.visibility="hidden";
         document.getElementById(id+'-form-submit').style.visibility="visible";
     }
}

<g2:button style="visibility:visible;" id="${g2:escapeXml(componentId)}-form-submit" name="submitButton" type="submit" value="Search" bamId="${searchBarBam}" actionName="${action}" inputClass="p-userSearchButton" />&nbsp;

<input style="visibility:hidden;" type="button"  class="p-userSearchButton" name ="searchinresult" id="searchwithin_${componentId}_searchButton" value="Search Within" onClick="javascript:($C('${componentId}')).filterBySearchWithIn('${searchBarBam}','${componentId}-form-text');"></input>

I need to change it like:

document.getElementById('searchwithin_'+id+'_searchButton').style.display="none";
     document.getElementById(id+'-form-submit').style.display="true";

<g2:button style="display:true;" 
           id="${g2:escapeXml(componentId)}-form-submit" 
           name="submitButton" 
           type="submit" 
           value="Search" 
           bamId="${searchBarBam}" 
           actionName="${action}" 
           inputClass="p-userSearchButton" />&nbsp;

<input style="display:none;" 
       type="button"  
       class="p-userSearchButton" 
       name ="searchinresult" 
       id="searchwithin_${componentId}_searchButton" 
       value="Search Within" 
       onClick="javascript:($C('${componentId}')).filterBySearchWithIn('${searchBarBam}','${componentId}-form-text');"></input>

But it’s not working.

  • 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-25T12:06:26+00:00Added an answer on May 25, 2026 at 12:06 pm

    You want display: none; not visibility: hidden.

    Edit

    In your edited code you use display: true to show a button, but correct syntax would be: display: inline. For more display options view: w3schools.com/css/css_display_visibility.asp.

    If this does not fix your problem, please define more clearly what your issue is exactly.

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

Sidebar

Related Questions

Problem: I have two spreadsheets that each serve different purposes but contain one particular
This is a simplified version of my problem. I have two buttons, and one
Trying to solve a problem with templatetags. I have two templatetags: @register.inclusion_tag('directory/_alphabet.html') def alphabet_list(names):
I have the following HTML code, what I want to do is to split
I have included my two code sources below. The problem that I am having
For a site I'm developing I have two html buttons, not ASP because I
I have HTML two forms, one that submits data upon entry to a database
I have a form that has two buttons. One for saving a record and
I have two html text input fields and two buttons. The first button saves
I have a problem with two Textviews on the same height in a RelativeLayout

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.