Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


vbscript: is it posible, have a check box on a web page and if not checked in a certian time it continues and write line to a file

Posted on 2004-07-31
Medium Priority
Last Modified: 2012-06-21
im looking to make a page with a check box and then after lets say 30 seconds it checks for default checked checkboxes/and checked checkboxes and continues writing what boxes where checked toa text file

is this posible?

if it is whats the code for it as i have no clue where to start.

thanks alot for any help and will award more points if you want as i think this is a very hard question as i cant do it at all.

thanks again
Question by:Johnny
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 17

Accepted Solution

zzzzzooc earned 2000 total points
ID: 11686104
>>i have no clue where to start.
It wouldn't be a problem if I didn't have to write VBScript in notepad but since I do, here's just a snippet to get you started...

<script language="VBScript">
    sub Test()
        Dim objCol, objItem
        Set objCol = Document.All.tags("input")
        For Each objItem In objCol
            If objItem.Type = "checkbox" Then
                If objItem.Checked = True Then
                    MsgBox objItem.Name & " is checked."
                    MsgBox objItem.Name & " is unchecked."
                End If
            End If
    end sub
<input name="Check1" type="CheckBox">My Check1<br>
<input name="Check2" type="CheckBox">My Check2<br>
<input name="Check3" type="CheckBox">My Check3<br>
<input type="Button" value="Testing" onClick="Test()">

Author Comment

ID: 11687814
using the above example heres what i want to do

<input name="Check1" type="CheckBox">My Check1<br>
<input name="Check2" type="CheckBox">My Check2<br>
<input name="Check3" type="CheckBox">My Check3<br>

would need to have the info read in from a file like checkbox.ini/checkbox.txt or something so that the fields check1 and my check1 can be grabed from the file.

next it would have a default(checked state) when grabed from that same checkbox.ini/checkbox.txt so they will show up prechecked when it loads or a button is pressed.

next it would then write to another text file lets say results_checkbox.txt what checkboxes where in fact check marked.

i wish i could do this in java i think that would be alot easer but heres my problem if anyone else has a sugestion im very open to making this happin...

im looking to be able to install a few programs with a clean install of xp and i want to be able to pick the programs installed.well java in not installed as a default anymore and to get it to install does not always take till next reboot or at all if theres a problem. so NO java(no JOY). im not sure if vb will work too as doesnt some of the files have to be present for that to work too.
im looking for checkboxes to be able to select what programs to install(id like it to be in html format, but not relaly nessary as long as its checkboxes.)

any farther help would be great and yes i will award more points as this is involved and odd.
Thanks again
LVL 17

Expert Comment

ID: 11689231
>>and yes i will award more points as this is involved and odd
You can't offer more than 500pts for a single question. You may find it best to open additional questions and ask portions of what you're trying to do within them. They'll be answered quickly if they don't require so much time (for the Expert) to answer.

For now, I'll direct you to sites that'll cover some areas..

>>would need to have the info read in from a file
>>next it would then write to another text file
You can CreateObject() the FSO and use that. Even though the below mentions ASP, it can of course be used for VBScript.

"How To Manipulate Text Files in an ASP Page"

>>next it would have a default(checked state)
My previous example detailed how to get the checked state. To set it, it's similar. (objItem.Checked = True/False)

Author Comment

ID: 11690379
ok im pretty close to everything but i keep getting an error for the CreateObject() the FSO something about active x cant open CreateObject() the FSO thingy...

i also need the timmer to fire off the submit button but as you said ill ask that in another question

ill award you the points as you did answer and point me inthe right direction as i couldnt find out how to start with this...

thanks again
LVL 17

Expert Comment

ID: 11690564
It may depend on your browser's security permissions whether it can create the object or not. Here's an example that MsgBox's the # of drives your system has.

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
msgbox "You have " & objFSO.drives.count  & " drives."

Good luck though. :)

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question