Export (0) Print
Expand All
GUI
Expand Minimize

Creating Your Own HTAs

Try It Yourself: Add Radio Buttons to an HTA


Shows how to add radio buttons to an HTA. This is the answer to a Try It Yourself exercise found in Part 2 of the introductory tutorial on creating HTAs.



<html>
<head>
<title>HTA_Test</title>
<HTA:APPLICATION 
     ID="objTest" 
     APPLICATIONNAME="HTATest"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
>
</head>

<SCRIPT LANGUAGE="VBScript">

    Sub TestSub
        For Each objButton in RadioOption
            If objButton.Checked Then
                Msgbox "You selected " & objButton.Value & "."
            End If
        Next
    End Sub

</SCRIPT>

<body>

    <input type="radio" name="RadioOption" value="atl-dc-01">atl-dc-01<BR>
    <input type="radio" name="RadioOption" value="atl-dc-02">atl-dc-02<BR>
    <input type="radio" name="RadioOption" value="atl-dc-03">atl-dc-03<P>
    <input id=runbutton  class="button" type="button" value="Run Script" name="run_button"  onClick="TestSub">

</body>



Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft