Solved

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
5
446 Views
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
Pern
0
Comment
Question by:Johnny
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 500 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...

<html>
<head>
<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."
                Else
                    MsgBox objItem.Name & " is unchecked."
                End If
            End If
        Next
    end sub
</script>
</head>
<body>
<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()">
</form>
</body>
</html>
0
 

Author Comment

by:Johnny
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
0
 
LVL 17

Expert Comment

by:zzzzzooc
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"
http://support.microsoft.com/default.aspx?scid=kb;en-us;300982

>>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)
0
 

Author Comment

by:Johnny
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
0
 
LVL 17

Expert Comment

by:zzzzzooc
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.

<SCRIPT LANGUAGE="VBScript">
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
msgbox "You have " & objFSO.drives.count  & " drives."
</SCRIPT>

Good luck though. :)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now