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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbscript create input with checkbox or radiobutton

Status
Not open for further replies.

kaul1jos

Technical User
Jan 5, 2001
76
NL
Hi,

I'd like to create a windows WSH vbs with the posibility to use radiobuttons.

Does anybody know how to resolve my problem?

Thanks in advance
 
You have two main options as far as I know. One would be to write your own DLL to provide this functionality. The other would be to use HTA. Of the two, personally I'd use HTA.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Save this as an hta file:
Code:
<HTML>
	<HEAD>
	<HTA:APPLICATION ID="oFinder"
     APPLICATIONNAME="Finder"
     BORDER="thin"
     BORDERSTYLE="normal"
     CAPTION="yes"
     ICON=""
     MAXIMIZEBUTTON="yes"
     MINIMIZEBUTTON="yes"
     SHOWINTASKBAR="yes"
     SINGLEINSTANCE="no"
     SYSMENU="yes"
     VERSION="1.00"
     WINDOWSTATE="maximize"/>

	<TITLE></TITLE>
	<META http-equiv=Content-Type content="text/html; charset=utf-8"><script id=clientEventHandlersVBS language=vbscript>
	<!--
	
		Dim strReply
		strReply = "Nothing"
	
		Sub btnReply_onclick
			MsgBox strReply & " is selected"
		End Sub
	
		Sub rdoOne_onclick
			rdoOne.status = True
			rdoTwo.status = False
			rdoThree.status = False
			strReply = "ONE"
		End Sub
	
		Sub rdoTwo_onclick
			rdoOne.status = False
			rdoTwo.status = True
			rdoThree.status = False
			strReply = "TWO"
		End Sub
	
		Sub rdoThree_onclick
			rdoOne.status = False
			rdoTwo.status = False
			rdoThree.status = True
			strReply = "THREE"
		End Sub
	
	-->
	</script>
	</HEAD>
	<BODY>
		<p>
		 <input 
		id=rdoOne type=radio>&nbsp;One</p>
		<p>
		 <input id=rdoTwo type=radio>&nbsp;Two</p>
		<p>
		 <input id=rdoThree type=radio>&nbsp;Three</p>
		<p>
		 <input id=btnReply type=button value=Reply></p>
	</BODY>
</HTML>

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
thanks, and this file must be used as input for my further vbscript in Windows?
 
No, this is merely an example of imbedding vbscript in an HTA. To see the example, double click on the file.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top