• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 330
  • Last Modified:

how to hide selectbox in vbscript...

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
williamsF1
Asked:
williamsF1
  • 3
  • 3
1 Solution
 
venkateshwarrCommented:

If you are using asp, then do not display the code for selectbox...
0
 
venkateshwarrCommented:
If you need to hide you can just say...

form1.selRef1.style.visibility = hidden
0
 
williamsF1Author Commented:

what do you mean "do not display the code?"....Don't put it as Clientside?  
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
williamsF1Author Commented:
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
 
williamsF1Author Commented:
got it...added the = "hidden" , needed the qoutes.

So, what did you mean on "do not display the code?"....
0
 
venkateshwarrCommented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now