Rachel Phillips
2019-08-20 21:41:09 UTC
how is this done in script for cscript.exe?
I don't know if your problem is related to array of HTML elements or not.
Try this code and look if it can help you or it can suggest anything useful.
<HTML>
<TITLE>How To manage Array of HTML Elements HTML in VBScript.</TITLE>
<HEAD></HEAD>
<BODY>
<SCRIPT LANGUAGE="VBScript">
Sub cmdStart_OnClick()
For x = 0 To 9
If Document.frmID.Elements(x).Value = "" Then
Document.frmID.Elements(x).Value = "txtTextBox" & x + 1
End If
Next
MsgBox "I listed all textboxes as an array of elements. Now i will proceed
with the verify of the txtTextBox5 existence then i will set its value to
'0'."
For x = 0 To 9
If Document.frmID.Elements(x).Value = "txtTextBox5" Then
MsgBox "The fifth textbox contains the name: txtTextBox5. When you will
press 'OK' , its value will be '0'."
Document.frmID.Elements(x).Value = "0"
End If
Next
End Sub
Sub cmdStart2_OnClick()
For y = 0 TO 4
If Document.frmID2.Elements(y).Value = "" Then
Document.frmID2.Elements(y).Value = "txtTextBox" & y + 1
End If
Next
End Sub
</SCRIPT>
<FORM Name="frmTry" Id="frmID">
<%
For x = 1 To 10
%>
<INPUT Type="Text" Name="txtTextBox<%= x%>">
<%
Next
<INPUT Type="Button" Name="cmdStart" Value="Start">
</FORM>
<FORM Name="frmStart2" Id="frmID2">
<%
For y = 1 To 5
<CENTER>
<INPUT Type="Text" Name="txtTextBox<%= y%>">
</CENTER>
<%
Next
%>
<CENTER>
<INPUT Type="Button" Name="cmdStart2" Value="Start 2">
</CENTER>
</FORM>
</BODY>
</HTML>
----- Original Message -----
Newsgroups: microsoft.public.scripting.vbscript
Sent: Thursday, June 08, 2000 12:00 PM
Subject: (newbie) how to access radio button in vbs?
Try this code and look if it can help you or it can suggest anything useful.
<HTML>
<TITLE>How To manage Array of HTML Elements HTML in VBScript.</TITLE>
<HEAD></HEAD>
<BODY>
<SCRIPT LANGUAGE="VBScript">
Sub cmdStart_OnClick()
For x = 0 To 9
If Document.frmID.Elements(x).Value = "" Then
Document.frmID.Elements(x).Value = "txtTextBox" & x + 1
End If
Next
MsgBox "I listed all textboxes as an array of elements. Now i will proceed
with the verify of the txtTextBox5 existence then i will set its value to
'0'."
For x = 0 To 9
If Document.frmID.Elements(x).Value = "txtTextBox5" Then
MsgBox "The fifth textbox contains the name: txtTextBox5. When you will
press 'OK' , its value will be '0'."
Document.frmID.Elements(x).Value = "0"
End If
Next
End Sub
Sub cmdStart2_OnClick()
For y = 0 TO 4
If Document.frmID2.Elements(y).Value = "" Then
Document.frmID2.Elements(y).Value = "txtTextBox" & y + 1
End If
Next
End Sub
</SCRIPT>
<FORM Name="frmTry" Id="frmID">
<%
For x = 1 To 10
%>
<INPUT Type="Text" Name="txtTextBox<%= x%>">
<%
Next
<INPUT Type="Button" Name="cmdStart" Value="Start">
</FORM>
<FORM Name="frmStart2" Id="frmID2">
<%
For y = 1 To 5
<CENTER>
<INPUT Type="Text" Name="txtTextBox<%= y%>">
</CENTER>
<%
Next
%>
<CENTER>
<INPUT Type="Button" Name="cmdStart2" Value="Start 2">
</CENTER>
</FORM>
</BODY>
</HTML>
----- Original Message -----
Newsgroups: microsoft.public.scripting.vbscript
Sent: Thursday, June 08, 2000 12:00 PM
Subject: (newbie) how to access radio button in vbs?
Hi,
New to VBScript, fairly old-hand in VB6.
Can someone tell me how to define the click event for a rdio button within
aNew to VBScript, fairly old-hand in VB6.
Can someone tell me how to define the click event for a rdio button within
group?? Normal buttons no problem, just use (say) "sub b1_onclick", but
what is the syntax if you have two radio buttons in a group, one with
groupname R1 value V1, one with groupname R1, value V2?? I've tried "sub
r1.v1_onclick", "sub r1(v1)_onclick" and get syntax error. "sub
r1_onclick"what is the syntax if you have two radio buttons in a group, one with
groupname R1 value V1, one with groupname R1, value V2?? I've tried "sub
r1.v1_onclick", "sub r1(v1)_onclick" and get syntax error. "sub
or "sub v1_onclick" are accepted, but nothing happens.
Any advice welcomed
Thanks,
Roger
Hi,
New to VBScript, fairly old-hand in VB6.
Can someone tell me how to define the click event for a rdio button within
aAny advice welcomed
Thanks,
Roger
Hi,
New to VBScript, fairly old-hand in VB6.
Can someone tell me how to define the click event for a rdio button within
group?? Normal buttons no problem, just use (say) "sub b1_onclick", but
what is the syntax if you have two radio buttons in a group, one with
groupname R1 value V1, one with groupname R1, value V2?? I've tried "sub
r1.v1_onclick", "sub r1(v1)_onclick" and get syntax error. "sub
r1_onclick"what is the syntax if you have two radio buttons in a group, one with
groupname R1 value V1, one with groupname R1, value V2?? I've tried "sub
r1.v1_onclick", "sub r1(v1)_onclick" and get syntax error. "sub
or "sub v1_onclick" are accepted, but nothing happens.
Any advice welcomed
Thanks,
Roger
Any advice welcomed
Thanks,
Roger