Link to home
Start Free TrialLog in
Avatar of williamsF1
williamsF1

asked on

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?

Avatar of venkateshwarr
venkateshwarr


If you are using asp, then do not display the code for selectbox...
ASKER CERTIFIED SOLUTION
Avatar of venkateshwarr
venkateshwarr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of williamsF1

ASKER


what do you mean "do not display the code?"....Don't put it as Clientside?  
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">


got it...added the = "hidden" , needed the qoutes.

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