Disable Buttons (VBS)

Hewlett-packard / Sd2100
March 7, 2010 at 03:46:03
Specs: Windows 7, 1024
I get this error Why?

Object doesn't support this property or method: 'RadioOption.disabled'

What i want to do if RadioOptionS "Simple Radio" is selected then disable RadioOptionA the code is right well looks right but i still get that error. ive Bold'd the Sub Routine and the two i want disabled. any clues guys?


<html>
<head>
<title>Cleanup</title>
<HTA:APPLICATION
ID="objTest"
APPLICATIONNAME="HTATest"
SysMenu="no"
SCROLL="yes"
SINGLEINSTANCE="yes"
>
</head>
<body bgcolor="white">
Cleanup!


<SCRIPT Language="VBScript">
Sub Window_Onload
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
For Each objItem in colItems
intHorizontal = objItem.ScreenWidth
intVertical = objItem.ScreenHeight
Next
intLeft = (intHorizontal - 300) / 2
intTop = (intVertical - 400) / 2
window.resizeTo 600,500
window.moveTo intLeft, intTop
End Sub
</script>
<SCRIPT Language="VBScript">
Sub Disable
if RadioOptionS.Checked then
RadioOptionA.disabled=false
RadioOptionA.disabled=false

end if
End Sub

Sub TestSub
For Each objButton in RadioOption
If objButton.Checked Then
Stuff = objButton.Value
Set myFSO = CreateObject("Scripting.FileSystemObject")
Set WriteStuff = myFSO.OpenTextFile("select.txt", 8, True)
WriteStuff.WriteLine(Stuff)
WriteStuff.Close
window.Close()
End If
NEXT
End Sub

</script>
<body>
<input type="radio" name="RadioOptionS" onclick="Disable" value="s">Simple!
<input type="radio" name="RadioOption" onclick="TestSub" value="a">Advanced!

<input type="radio" name="RadioOption" onclick="TestSub" value="1">Maintenance!

<input type="radio" name="RadioOptionA" onclick="TestSub" value="2">Utilites!

<input type="radio" name="RadioOptionA" onclick="TestSub" value="3">CMD-Commands!

<input type="radio" name="RadioOption" value="4">Exit!


<input id=runbutton class="button" type="button" value="Change Menu" name="run_button" onClick="TestSub">


See More: Disable Buttons (VBS)

Report •

#1
March 7, 2010 at 10:53:03
Try if RadioOptionA.Enabled = True/False

Same result, different direction.

Stuart


Report •

#2
March 7, 2010 at 10:59:42
i had to do a lot of trial and error but this worked:
<input type="radio" name="RadioOptionS" onclick="Disable" value="s">Simple!

sub disable
radiooption(0).disabled=true
end sub

or, as you have changed your code somewhat:
sub disable
for each objbutton in radiooptionA
objbutton.disabled=true
next
end sub
ps: if you want to "stack" the buttons, put

between each <input> line.Or you can put them into a <table> for even more control.


Report •
Related Solutions


Ask Question