473,467 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Make button invisible in php

250 Contributor
I have a menu which is contain image buttons. I want to hide some buttons in some pages. This is my code and it's not working. I couldn't find the error. Please help me.
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.      document.form1.btn1.style.visibility="hidden";
  3. </script>
  4. <body><form name="form1" >
  5.  
  6.                 <table border="0" cellpadding="0" cellspacing="3">
  7.                     <tbody>
  8.                         <tr>
  9.                             <td><html:link action="/loadp1"><img src="images/Btn1.jpg" width="120" height="20"  border="0"  name="btn1"/></html:link></td>
  10.                             <td><html:link action="/admin"><img src="images/AdminBtn.jpg" width="120" height="20"  border="0" id="admin"/></html:link></td>
  11.                             .............
  12.                         </tr>
  13.                     </tbody>
  14.                 </table>
  15.         </form>
  16.  
  17.     </body>
  18.  
May 3 '10 #1
6 5704
gits
5,390 Recognized Expert Moderator Expert
give it an id and use:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('yourId').style.visibility='hidden';
kind regards
May 3 '10 #2
Dormilich
8,658 Recognized Expert Moderator Expert
Expand|Select|Wrap|Line Numbers
  1. <html:link action="/loadp1">
I don’t know what this is, but it’s not HTML (as it is now)
May 3 '10 #3
gits
5,390 Recognized Expert Moderator Expert
looks like struts-syntax ...and should render as a simple anchor tag?

kind regards
May 3 '10 #4
ghjk
250 Contributor
@gits
I put
Expand|Select|Wrap|Line Numbers
  1. document.getElementById(btn1).style.visibility='hidden';
  2.  
. and change the image id as btn 1. but it's not working.
May 4 '10 #5
ghjk
250 Contributor
@Dormilich
It's struts syntax. just a normal page load
May 4 '10 #6
gits
5,390 Recognized Expert Moderator Expert
@ghjk
you have to pass the id as a string:

Expand|Select|Wrap|Line Numbers
  1. document.getElementById('btn1').style.visibility='hidden';
  2.  
May 5 '10 #7

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

Similar topics

1
by: PCB | last post by:
Hi all, Not sure if this is possible, but can I change the controls of a command button on a per record bases in a subform. In my case, I would like to make a command button visible only if...
6
by: Paul Turley | last post by:
Does anyone have some sample script to "press" a button or image button when the user presses the Enter key? I see this behavior on a lot of web pages but I'm not finding any samples. Thx --...
3
by: tshad | last post by:
I am using the footer of my Datalist to add a row into my database. Is there a way to make the footer invisible when not adding a row, making it visible when a button is pushed and making it...
2
by: Dave | last post by:
hi, I'm have a control which inherits from the panel control and I want to make it invisible at design time -- like the Timer control. Any suggestions?? Thanks, davermcl
1
by: shapper | last post by:
Hello, I have a link button which signs out the user when it is clicked. I place on by button the code line ibLogout.Visible = My.User.IsAuthenticated. So, when the user is authenticated...
1
by: esateesh | last post by:
how to make a print button invisible in the printed page when a print is given
2
by: zeroblade | last post by:
I want to make the text invisible until the user presses a button, after which the text would appear. How would I make the text invisible?
1
by: Marina Chitchi | last post by:
In detail section of access report I have txtProblem. I put a line under this text. I want to make line invisible if txtProblem is null and visible if it populated (by the recordsource.
4
KeredDrahcir
by: KeredDrahcir | last post by:
I want to be able to use CSS to make a button invisible but for people still be able to select it if they manage to mouse over. I have no control of the HTML of the button and though this might...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.