glenn
Fri Mar 17 17:06:28 CST 2006
Thanks for your reply.
I need the button to be enabled or disabled when the page opens not when the
user clicks on it so I am not sure how to apply the W3Schools example.
For example:
<%
Dim pwd
if pwd="123" then
' enable the button
else
' disable the button
end if
"Umesh Thakur" wrote:
> I guess, once document is loaded, it parses all tags and displays the
> elements accordingly. if later, we try to change the tag definition in the
> way we did, we won't be able to. at runtime, we should be changing object
> properties using HTML DOM Object properties and methods. Here is a nice
> example that I think, will help you to do what you want:
>
>
http://www.w3schools.com/htmldom/prop_button_disabled.asp
>
>
> --
> -----
> Umesh
>
> "Old programmers never die. They just terminate and stay resident."
>
>
>
> "glenn" wrote:
>
> > Ok. I changed this to <% =btnState%> but the property for the button
> > remains unchanged.
> > If you hard code the <input> tag for a button to have disabled=true or
> > false, it will not change when you change the property value from true to
> > false. It seems this might be a bug. Try it, you will see.
> >
> > "Umesh Thakur" wrote:
> >
> > > > <input id=button1 type=button value=button disabled=<%btnState%>>
> > >
> > > change to:
> > >
> > > <input id=button1 type=button value=button disabled= <% =btnState %> >
> > >
> > > -----
> > > Umesh
> > >
> > > "Old programmers never die. They just terminate and stay resident."
> > >
> > >
> > >
> > > "glenn" wrote:
> > >
> > > > Can anyone tell me how to set the disabled property to true or false on the
> > > > fly.
> > > >
> > > > Seems like this should be a no brainer but maybe I'm missing something...
> > > >
> > > > If I set the following in a button <input> tag I cannot get it to change
> > > >
> > > > <input id=button1 type=button value=button disabled=false> should enable the
> > > > button
> > > >
> > > > <input id=button1 type=button value=button disabled=true> should disable the
> > > > button
> > > >
> > > > Actually, what happens is the button disabled property stays set to whatever
> > > > the properties window is set to. Changing the property in the tag does not
> > > > work.
> > > >
> > > > I want to have the button be enabled or disabled based on who my user is.
> > > > For example:
> > > >
> > > > Dim btnState
> > > > if rs("pwd") = "admin" then
> > > > btnState=false
> > > > else
> > > > btnState=true
> > > > end if
> > > >
> > > > <input id=button1 type=button value=button disabled=<%btnState%>>
> > > >
> > > > This seems to simple but I am obviously missing something.
> > > >
> > > > Thanks for any help...
> > > >
> > > >
> > > >