Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

how to hide selectbox in vbscript...

Posted on 2004-04-19
6
323 Views
Last Modified: 2008-03-06
I need to hide a selectbox depending on a cookie value

sub window_OnLoad()
     'I try to set aReflist var earlier...Req.Cookies"cRefList")
 alert aReflist  
    'if Request.Cookies("cRefList") = "1" then
 if aReflist = "1" then
   form1.selRef1.hidden.value = false
 else
   form1.selRef1.hidden.value = true
end if
End Sub

If this can't be done, can a java script read a cookie that was set in vb? What is the syntax for that?

0
Comment
Question by:williamsF1
  • 3
  • 3
6 Comments
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10859831

If you are using asp, then do not display the code for selectbox...
0
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 80 total points
ID: 10859850
If you need to hide you can just say...

form1.selRef1.style.visibility = hidden
0
 

Author Comment

by:williamsF1
ID: 10859871

what do you mean "do not display the code?"....Don't put it as Clientside?  
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:williamsF1
ID: 10860402
form1.selRef1.style.visibility = hidden
doesn't seem to work? Is it ok that it is in the window_onload()
I get my alert box [see above ] and I put your line after the alert.


<select name="selRef1" size="1" class="boldregulartext">


0
 

Author Comment

by:williamsF1
ID: 10860417
got it...added the = "hidden" , needed the qoutes.

So, what did you mean on "do not display the code?"....
0
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10861648
what I mean is if you are using asp,
you can just say,

if flag=1 then
   reponse.write "<input type=checkbox nam=test value=test>"
end if

Here as you see if the condition fails the ceckbox code is not written to the html... or rather is not displayed...
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Attaching a file to SMTP in Classic ASP 1 42
Auto Submit on dropdown box 14 72
JS does not refresh 6 30
Adjust an existing ASP Query 45 17
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question