InputBox with multiple fields (inputs) using VBScript?

Does anyone know if it is possible to create an InputBox that contains multiple fields (inputs) on a single input box using VBScript?  I'd like to ba able to set three variables using a single InputBox, rather than using three consecutaive InputBoxes.
morcianiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sirbountyCommented:
You could have something like:

Enter your selections, separating them with a comma:
Response1,Response2,Response3

And then use the Split function to grab the data:

arrValues = Split(strResponse, ",")

Other than that, I don't know of a way...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zabu99Commented:
Another option is to make your script (or at least part of it) an HTA.
This allows you to add several text boxes (or other controls) without having to click okay multiple times.



<HEAD>
<TITLE>HTA Sample</TITLE>
<hta:application
	applicationname="HTA Sample"
	scroll="yes"
	singleinstance'"yes"
	>
</HEAD>
 
<SCRIPT language="vbscript">
 
Sub RunThisSubroutine
	str1 = TextBox1.Value
	str2 = TextBox2.Value
	str3 = TextBox3.Value
	msgBox str1 & ", " & str2 & ", " & str3
End Sub
 
</SCRIPT>
 
<BODY STYLE="FONT:10 pt verdana; COLOR:black; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFCC66', EndColorStr='#FFFFFF')">
 
Hyper Text Applications make it easy to add user inputs: <BR>
<input type="text" name="TextBox1" size="30"><BR><BR>
<input type="text" name="TextBox2" size="30"><BR><BR>
<input type="text" name="TextBox3" size="30" value="A default value can go here"><BR><BR>
 
<input id=runbutton class= "button" type="button" value="Run" name="button1" onClick="RunThisSubroutine">
 
</BODY>

Open in new window

0
zabu99Commented:
Oh, you need to save the above script as "whatever.HTA"
(it might have been obvious, but just in case).
0
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

RobSampsonCommented:
Hi, VBScript itself is not capable of this.  You could either build a HTA:
http://www.microsoft.com/technet/scriptcenter/hubs/htas.mspx

You could also try this custom message box component:
http://www.jsware.net/jsware/scripts.php5#msgb

although I haven't used it yet, and I'm not sure if it support multiple inputs....

Regards,

Rob.
0
RobSampsonCommented:
Ah, didn't refresh for 15 minutes.....zabu has provided a good HTA example...

Rob.
0
morcianiAuthor Commented:
Excellent.... both solutions work!
0
OutinCommented:
For others looking for a solution:

Depending on why you want multi-line input, you might also be able to use the clipboard instead of an input field.

Code example by 'E'

Full post on http://www.actuarialoutpost.com/actuarial_discussion_forum/showthread.php?p=3613458

Worked for me :-)

Best regards,
Outin

Dim fso
Dim objIE
Dim sText
Set fso = CreateObject("Scripting.FileSystemObject")
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate "about:blank"
Do Until objIE.ReadyState=4: WScript.Sleep 1: Loop
sText = objIE.Document.ParentWindow.ClipboardData.GetData("text")
objIE.Document.ParentWindow.ClipboardData.SetData "Text", sText
objIE.Quit

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.