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

HTML Form Field Values into Array??

Status
Not open for further replies.

MNass

IS-IT--Management
Jun 21, 2001
1
US
Hi,

I am new to VBScript, but I am trying to create a logon script that will recognize a user the first time they log on, and present them with a HTML "interview" which asks them what printers they would like to be mapped to, as well as other things. The page will write the results to a .ini file and another script will set up their environment based on the entries in that .ini file. I have figured out how to do this functionality with all other items on the interview, except a large number of checkboxes in the Form, each of which stand for a Printer. I turn the results of this into an array in my VBScript. What is not working for me is I am getting the name of the field that I want the value of, not the value that I want. I want AddPrinter = True, but I am getting AddPrinter = Document.FirstTimeLogonForm.OEQMS1.Checked . Any suggestions. I am sure it is something easy, but like I said I am new. I have attatched the script below.

Thanks,

Michael Nass

<SCRIPT LANGUAGE=&quot;VBScript&quot;>
<!--
Sub SubmitFirstTimeLogon_OnClick
on error resume next

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f

set adsys = CreateObject(&quot;ADSystemInfo&quot;)
set wscr = CreateObject(&quot;WScript.Network&quot;)

outputfile = &quot;W:\&quot; & &quot;FTLI.ini&quot;

Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set f = fso_OpenTextFile(outputfile, ForWriting, True)

Dim AddPrinterStr
Dim AddPrinterNme
Dim AddPrinterChk
Dim Printer
Dim AddPrinterArray

' *** Add Additional Printers ***
FormPrefix = &quot;Document.FirstTimeLogonForm.&quot;
Printer1 = FormPrefix & &quot;OEQMS1&quot;
Printer2 = FormPrefix & &quot;OEQMS2&quot;
Printer3 = FormPrefix & &quot;OEQMS3&quot;
Printer4 = FormPrefix & &quot;OEQMS4&quot;
Printer5 = FormPrefix & &quot;OEQMS5&quot;
Printer6 = FormPrefix & &quot;OEQMS6&quot;
Printer7 = FormPrefix & &quot;OEQMS7&quot;
Printer8 = FormPrefix & &quot;OEQMS8&quot;
Printer9 = FormPrefix & &quot;OEQMS9&quot;
Printer10 = FormPrefix & &quot;OEQMS10&quot;
Printer11 = FormPrefix & &quot;OEQMS11&quot;
Printer12 = FormPrefix & &quot;OEQMS12&quot;
Printer13 = FormPrefix & &quot;OEQMS13&quot;
Printer14 = FormPrefix & &quot;OEQMS14&quot;
Printer15 = FormPrefix & &quot;OEQMS15&quot;
Printer16 = FormPrefix & &quot;OEQMS16&quot;
Printer17 = FormPrefix & &quot;OEQMS17&quot;
Printer18 = FormPrefix & &quot;OEQMS18&quot;
Printer19 = FormPrefix & &quot;OEQMS19&quot;
Printer20 = FormPrefix & &quot;OEQMS20&quot;
Printer21 = FormPrefix & &quot;OEQMS21&quot;
Printer22 = FormPrefix & &quot;OEQMS22&quot;
Printer23 = FormPrefix & &quot;OEQMS23&quot;
Printer24 = FormPrefix & &quot;OEQMS26&quot;
Printer25 = FormPrefix & &quot;OEQMS27&quot;
Printer26 = FormPrefix & &quot;COLOR-2N&quot;
Printer27 = FormPrefix & &quot;COLOR-2S&quot;
Printer28 = FormPrefix & &quot;COLOR-3N&quot;
Printer29 = FormPrefix & &quot;COLOR-3S&quot;
Printer30 = FormPrefix & &quot;HPCOLOR-1&quot;
Printer31 = FormPrefix & &quot;HPCOLOR-2&quot;
Printer32 = FormPrefix & &quot;HPCOLOR-3&quot;
Printer33 = FormPrefix & &quot;HPCOLOR-4&quot;
Printer34 = FormPrefix & &quot;HPCOLOR-5&quot;
Printer35 = FormPrefix & &quot;HPCOLOR-6&quot;
Printer36 = FormPrefix & &quot;HPCOLOR-7&quot;
Printer37 = FormPrefix & &quot;HPCOLOR-8&quot;
Printer38 = FormPrefix & &quot;HPLJ-1&quot;
Printer39 = FormPrefix & &quot;HPLJ-2&quot;
Printer40 = FormPrefix & &quot;HPLJ-3&quot;
Printer41 = FormPrefix & &quot;HPLJ-4&quot;
Printer42 = FormPrefix & &quot;HPLJ-5&quot;
Printer43 = FormPrefix & &quot;HPLJ-6&quot;
Printer44 = FormPrefix & &quot;HPLJ-7&quot;
Printer45 = FormPrefix & &quot;HPLJ-8&quot;
Printer46 = FormPrefix & &quot;HPLJ-9&quot;
Printer47 = FormPrefix & &quot;HPLJ-11&quot;
Printer48 = FormPrefix & &quot;HPLJ-12&quot;
Printer49 = FormPrefix & &quot;HPLJ-13&quot;
Printer50 = FormPrefix & &quot;HPLJ-14&quot;
Printer51 = FormPrefix & &quot;HPLJ-16&quot;
Printer52 = FormPrefix & &quot;HPLJ-17&quot;
Printer53 = FormPrefix & &quot;HPLJ-18&quot;
Printer54 = FormPrefix & &quot;HPLJ-19&quot;
Printer55 = FormPrefix & &quot;HPLJ-22&quot;
Printer56 = FormPrefix & &quot;HPLJ-23&quot;
Printer57 = FormPrefix & &quot;HPLJ-25&quot;
Printer58 = FormPrefix & &quot;HPLJ-27&quot;
Printer59 = FormPrefix & &quot;HPLJ-28&quot;
Printer60 = FormPrefix & &quot;HPLJ-29&quot;
Printer61 = FormPrefix & &quot;HPLJ-30&quot;
Printer62 = FormPrefix & &quot;HPLJ-32&quot;
Printer63 = FormPrefix & &quot;HPLJ-33&quot;
Printer64 = FormPrefix & &quot;XEROX-8830&quot;


AddPrinterArray = Array(Printer1,Printer2,Printer3,Printer4,Printer5,Printer6,Print
er7,Printer8,Printer9,Printer10,Printer11,Printer12,Printer1
3,Printer14,Printer15,Printer16,Printer17,Printer18,Printer1
9,Printer20,Printer21,Printer22,Printer23,Printer24,Printer2
5,Printer26,Printer27,Printer28,Printer29,Printer30,Printer3
1,Printer32,Printer33,Printer34,Printer35,Printer36,Printer3
7,Printer38,Printer39,Printer40,Printer41,Printer42,Printer4
3,Printer44,Printer45,Printer46,Printer47,Printer48,Printer4
9,Printer50,Printer51,Printer52,Printer53,Printer54,Printer5
5,Printer56,Printer57,Printer58,Printer59,Printer60,Printer6
1,Printer62,Printer63,Printer64)

For Each Printer in AddPrinterArray
AddPrinterVal = Printer & &quot;.Value&quot;
AddPrinterNme = Printer & &quot;.Name&quot;
AddPrinterChk = Printer & &quot;.Checked&quot;
'line = AddPrinterNme & &quot;=&quot; & AddPrinterVal
'If AddPrinterChk = &quot;True&quot; Then
MsgBox &quot;=&quot; & AddPrinterChk, 0, &quot;Value&quot;
'f.Writeline line
'End If
Next

f.close

End Sub
-->
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top