473,587 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hide/show hyperlinks

14 New Member
Hi all,

what i'm doing is showing/hiding hyperlinks depending on the hyperlink clicked. it is partially working. when i call step1, all hyperlinks are hidden. but then i call step2, single and mulitple is visible. the problem is when i call step1 again, it does not hide single and multiple hyperlinks. any idea to solve my problem? thanks in advance! below is my sample script...

function Step1()
{
document.all.di sappear.style.v isibility = "hidden";
}
function Step2(single, multiple)
{
document.all.di sappear.style.v isibility = "hidden";
document.getEle mentById(single ).style.visibil ity = "visible";
document.getEle mentById(multip le).style.visib ility = "visible";
}

by the way, i used <span id="disappear" > to hide the hyperlinks...
Jun 4 '07 #1
3 2863
iam_clint
1,208 Recognized Expert Top Contributor
when hiding the links I would hide them individually instead of in a span or div
using code something like this. then unhide individual links.
Expand|Select|Wrap|Line Numbers
  1. var links = document.getElementsByTagName("A");
  2. for (i=0; i<links.length; i++) { 
  3.  links[i].style.visibility = "hidden";
  4. }
  5.  
Jun 4 '07 #2
prinsipe
14 New Member
when hiding the links I would hide them individually instead of in a span or div
using code something like this. then unhide individual links.
Expand|Select|Wrap|Line Numbers
  1. var links = document.getElementsByTagName("A");
  2. for (i=0; i<links.length; i++) { 
  3.  links[i].style.visibility = "hidden";
  4. }
  5.  
hi clint

i'm using asp .net. i used asp to create the hyperlinks. im having a hard time getting the controls in asp and manipulate them in javascript. when i set the property of hyperlinks (around 20) to visible = false in asp .net (on page load, i want almost all links to be hidden. then by clicking a link, some links should be visible and others should be hidden), i can not set it to visible using javascript...
Jun 5 '07 #3
iam_clint
1,208 Recognized Expert Top Contributor
your server side app has nothing todo with this. So if that code don't work for you show me your code and I will continue to help you.

visible = false is wrong
visibility = 'hidden'; is right
and to make them visible is
visibility = 'visible';
Jun 5 '07 #4

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

Similar topics

5
4493
by: Steve | last post by:
Visual Studio 2003 C# Windows: I have a tree view control as my main menu control down the left side of my application. This has 2 Parent Nodes on it (Jobs and Employees). beneath these 2 main functions I have 2 sub functions under each("Add Job", "View Jobs" and "Add User", "View Users"). I have theses subfunctions grouped in a...
5
3016
by: Ray | last post by:
Hi, I was wondering if anyone has any idea how this can be done. I am trying to show/hide navigation links based on server names or ip addresses. So if, someone visits a particular url/ip address he/she sees only a particular set of navigation links. I am sure this can be done using some kind of Java script or VB script, just not sure how. I...
0
2090
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display some stuff in the main display area. The stuff to display is one of many assemblies loaded at the opening of the application by...
5
1458
by: Patrick.O.Ige | last post by:
What are the best ways to hide hyperlinks from visitors? Any ideas
4
4217
by: bridgemanusa | last post by:
Hi All: I have a very long page of html that I want to take portions and hide them in divs, then show when a link is clicked. I have the hide show part working when the link is clicked, however I would really like to use linked images instead to do the following: - When open.gif is clicked, the contents of the div show and open.gif is...
2
3121
by: prefersgolfing | last post by:
Is there a way to hide the query string in the address bar?
7
29130
by: FP | last post by:
I'm new to Java Script. I'm displaying comments people have made. Below each persons' comment I want to add 2 buttons "Reply" and "Amend". Clicking "Reply" would display an empty text field below the comment with a spell check & submit button. Clicking "Amend" would display the same buttons & text field but pre-populated with the original...
5
8422
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of form tags and div elements say n. The problem
1
4161
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. I don`t want to change the way i have used to show and hide layers. check down code :- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
0
7849
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8347
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7973
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5394
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.