×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

I haven't scripted in 15+ years. Please help!!

I haven't scripted in 15+ years. Please help!!

I haven't scripted in 15+ years. Please help!!

(OP)
I have this code that I have borrowed bits and pieces of from multiple sources. The object of this code is for a technician to click submit on what software packages need to be installed on a computer. Then the script needs to make a file with the same name as the value of that submit button. I know how to do this by creating seperate subroutines for each submit button, but I would like to have one sub routine that parses the necessary data to create the proper file name. Can I use the value property to pass this information over to vbscript? Here is the code:

CODE --> VBScript

<HEAD>
<TITLE>HTA Sample</TITLE>
<hta:application
	applicationname="HTA Sample"
	scroll="yes"
	singleinstance'"yes"
	>
</HEAD>
 
<SCRIPT language="vbscript">
Set objFSO=CreateObject("Scripting.FileSystemObject")
Sub dymo
	str1 = "dymo"
outFile="c:\test\dymo.txt"
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write  str1
objFile.Close	
msgBox "File Created"
End Sub

</SCRIPT>
 
<BODY STYLE="FONT:10 pt verdana; COLOR:black; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFCC66', EndColorStr='#FFFFFF')">
 
<input id=runbutton class= "button" type="button" value="Dymo" name="button1" onClick="dymo"><BR>
 <input id=runbutton class= "button" type="button" value="RightFax" name="button2" onClick="RunThisSubroutine"><BR>
 <input id=runbutton class= "button" type="button" value="Vidyo" name="button3" onClick="RunThisSubroutine"><BR>
 <input id=runbutton class= "button" type="button" value="eCW Plugin Upgrade" name="button4" onClick="RunThisSubroutine"><BR>
 <input id=runbutton class= "button" type="button" value="eCW EXE Test" name="button5" onClick="RunThisSubroutine"><BR>
 <input id=runbutton class= "button" type="button" value="eCW Web Test" name="button6" onClick="RunThisSubroutine"><BR>
  <input id=runbutton class= "button" type="button" value="2x" name="button7" onClick="RunThisSubroutine"><BR>
 <input id=runbutton class= "button" type="button" value="Outlook" name="button8" onClick="RunThisSubroutine"><BR>
 <input id=runbutton class= "button" type="button" value="Skype" name="button9" onClick="RunThisSubroutine"><BR>
 <input id=runbutton class= "button" type="button" value="VPN" name="button1a" onClick="RunThisSubroutine"><BR>
 <input id=runbutton class= "button" type="button" value="Banner" name="button2a" onClick="RunThisSubroutine"><BR>
 
</BODY> 

RE: I haven't scripted in 15+ years. Please help!!

This should do it.

CODE

<HEAD>
<TITLE>HTA Sample</TITLE>
<hta:application
	applicationname="HTA Sample"
	scroll="yes"
	singleinstance'"yes"
	>
</HEAD>

<SCRIPT language="vbscript">
Set objFSO=CreateObject("Scripting.FileSystemObject")
Sub GetBtnVal
	str1 = window.event.srcelement.value
    outFile="c:\test\" & str1 & ".txt"
    Set objFile = objFSO.CreateTextFile(outFile,True)
    objFile.Write str1
    objFile.Close
    msgBox "File Created"
End Sub
</SCRIPT>
 
<BODY STYLE="FONT:10 pt verdana; COLOR:black; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFCC66', EndColorStr='#FFFFFF')">
 
 <input id=runbutton class= "button" type="button" value="Dymo" name="button1" onClick="VBScript:GetBtnVal()"><BR>
 <input id=runbutton class= "button" type="button" value="RightFax" name="button2" onClick="VBScript:GetBtnVal()"><BR>
 <input id=runbutton class= "button" type="button" value="Vidyo" name="button3" onClick="VBScript:GetBtnVal()"><BR>
 <input id=runbutton class= "button" type="button" value="eCW Plugin Upgrade" name="button4" onClick="VBScript:GetBtnVal()"><BR>
 <input id=runbutton class= "button" type="button" value="eCW EXE Test" name="button5" onClick="VBScript:GetBtnVal()"><BR>
 <input id=runbutton class= "button" type="button" value="eCW Web Test" name="button6" onClick="VBScript:GetBtnVal()"><BR>
 <input id=runbutton class= "button" type="button" value="2x" name="button7" onClick="VBScript:GetBtnVal()"><BR>
 <input id=runbutton class= "button" type="button" value="Outlook" name="button8" onClick="VBScript:GetBtnVal()"><BR>
 <input id=runbutton class= "button" type="button" value="Skype" name="button9" onClick="VBScript:GetBtnVal()"><BR>
 <input id=runbutton class= "button" type="button" value="VPN" name="button1a" onClick="VBScript:GetBtnVal()"><BR>
 <input id=runbutton class= "button" type="button" value="Banner" name="button2a" onClick="VBScript:GetBtnVal()"><BR>
 
</BODY> 

Swi

RE: I haven't scripted in 15+ years. Please help!!

(OP)
Swi,

I wanted to say thank you for your reply it really helped me out. If you ever need anything 3d printed let me know. I would be happy to help you.

RE: I haven't scripted in 15+ years. Please help!!

Quote (Robert.Bartman)

I wanted to say thank you for your reply it really helped me out.

Do you see the Great Post link in swi’s lower eight-hand corner?

These little purple stars act as a “Thank you!” and identify posts for other members browsing for helpful tips.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: I haven't scripted in 15+ years. Please help!!

(OP)
Thanks for the heads up SkipVought. I clicked it. :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close