Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a button disappear

Status
Not open for further replies.

jwalz

Programmer
Oct 31, 2000
78
US
I want to drive the appearance of a push button or commandbutton based on whether or not a check box is selected on my Active Server Page. I am trying to use the button's visible property, but nothing happens. I can access the button control, because I am able to change what the button says based on this. Any ideas where I am going wrong?

Here is the VBScript Sub that I am trying to use:
Sub OriginatorPDM_onclick()
If (Document.FrontPage_Form1.OriginatorPDM.Checked = True) then
Document.FrontPage_Form1.B0.Visible = True
Document.FrontPage_Form1.B0.Value = "Save/Continue"
else
Document.FrontPage_Form1.B0.Visible = False
Document.FrontPage_Form1.B0.Value = "No Go!"
end if
End Sub

Thanks!
Janet
 
You would use the style property of the button.

Ex-------------------------------------------------

Sub OriginatorPDM_onclick()
If (Document.FrontPage_Form1.OriginatorPDM.Checked = True) then
Document.FrontPage_Form1.B0.style.display = "inline"
Document.FrontPage_Form1.B0.Value = "Save/Continue"
else
Document.FrontPage_Form1.B0.style.display = "none"
Document.FrontPage_Form1.B0.Value = "No Go!"
end if
End Sub
------------------------------------------------------

Make sure you set the display property initially on the button to defualt to "none". So the button will not display until your checkbox is checked.


"did you just say Minkey?, yes that's what I said."

MrGreed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top