Solved

how to hide selectbox in vbscript...

Posted on 2004-04-19
6
325 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
[X]
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
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

734 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