473,382 Members | 1,376 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Hide HTML Button

How to make html button hide. I tried enable and hide true/false.
Jul 3 '12 #1
4 51786
ariful alam
185 100+
You can do this using Javascript. check the following code. I used 2 button here. 2nd button is hidden at the start up. when you click on 1st button, the 2nd button will show and the first button will hide. similarly when you click on 2nd button, the 1st button will show and the 2nd button will hide.

Expand|Select|Wrap|Line Numbers
  1. <input id='btn_1' type='button' value='button 1' onclick='javascript:show_hide("btn_1","btn_2")'/>
  2.     <input id='btn_2' type='button' value='button 2' style='visibility:hidden' onclick='javascript:show_hide("btn_2","btn_1")'/>
  3.  
  4.     <script language='javascript' type='text/javascript'>
  5.  
  6.         function show_hide(id2hide, id2show)
  7.         {
  8.             document.getElementById(id2hide).style.visibility='hidden';
  9.             document.getElementById(id2show).style.visibility='visible';
  10.         }
  11.  
  12.     </script>
  13.  
hope its work for you.
Jul 5 '12 #2
use visibility:hidden in the css ..
for more help.[Link removed]
Jan 2 '13 #3
You can use CSS to make button hidden or visible with the help of visibility attribute.
Example :

<input type="button" id="btnsubmit" style="visibility:hidden;">
Jan 4 '13 #4
Anas Mosaad
185 128KB
There's a difference between CSS visibility and display attributes. Visibility make the object hidden but still takes place in the layout which for example might affect the printing.
I would recommend you to use display:none instead.
Jan 5 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Matt | last post by:
The code <input type="button" name="btn" value="ok"> will produce a html button with caption ok and value ok. The problem is the width of button is dependent on the length of attribute value. ...
3
by: FantaJ | last post by:
Hi, Is it possible to make a html button invisible using javascript? I can certainly disable it: var x=document.getElementById('button2'); x.disabled=true; //x.type = 'hidden'; // read...
7
by: J-T | last post by:
I have a user control called "Test1" with two button on it ,one is input and the other one is a server control as follow: <input type="button"...
1
by: Bishoy George | last post by:
I have an html button that reads a text box and runs a javascript. I made a Required Validator on that text box , any web button follows that validator. My html button does not follow the...
4
by: Ryan | last post by:
Hello, I have a standard HTML button on an aspx web form that I have set to runat server. The button is named reset1 and its tag is as follows: <INPUT id="btnReset1" style="WIDTH: 60px;...
6
by: Magic Gooddy | last post by:
Hi! How to hide Start Button in VB.NET? I know in VB6 and want to see this sample in VB.NET. Can anybody create worked sample?
9
by: john_woo | last post by:
Hi, I'm wondering how to use javascript to do something like: TOP_Button when clicking on it, it becomes: TOP_Button
0
by: jimryder | last post by:
I have an HTML button next to a Webcontrol Command button on my aspx page. They don't look the same! I know how to style, I just don't know what style to use to make the HTML button look like...
1
by: MOUSTAFA ARAFA | last post by:
Dear All, i want to hide next button programatically in weizard control,i tried the find control function,but it deosnt work ? can anyone help me on that ?
3
by: kevinpublic | last post by:
I have an item list for ordered products on a data grid in VS 2003. It's an ASP page running VB behind it. All detail lines display as well as all shipping charges. On the edit screen, we allow...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.