Radio Button Capture Setting In VB

J

Jim Quast

I have an ASP page and a CREGReports002.vbs file coded to export data to
excel. I do this by building variables in a stored procedure. The ASP page
has text boxes, list boxes, and radio buttons. I also placed two buttons on
the form. One submits the form to redirect to the Crystal Web Viewer
(genCREGReports.ASP). The other one executes VB code in a vbs document that
spawns some more code to run a stored procedure with the values from the ASP
page entries that where entered into the text boxes, list boxes, and radio
buttons and the launches ExcelOut.asp to export the data. All data is
captured except for the radio buttons. How do I capture the radio button
setting without submitting the form? What is the syntax to capture the value
from the radio button?

Below is some of the code from the two documents.

<script language="vbscript" type="text/vbscript"
src="VBScript/CREGReports002.vbs"></script>

<%
'Build url to pass to the next page to spawn the Crystal Report ActiveX Viewer
urlOut = ""
urlOut=urlOut & "../genCREGReports.ASP?"
urlOut=urlOut & "cmbReports=" & ReportNum 'ReportProc(objConn)
urlOut=urlOut & "&ReportName=" & ReportName 'ReportProc(objConn)
urlOut=urlOut & "&ReportProc=" & ReportProcName 'ReportProc(objConn)
urlOut=urlOut & "&txtSOEID=" & SOEID

'Build url to pass to the export page.
urlOut2 = ""
urlOut2=urlOut2 & "ExcelOut.asp?"
urlOut2=urlOut2 & "cmbReports=" & ReportNum 'ReportProc(objConn)
urlOut2=urlOut2 & "&ReportName=" & ReportName 'ReportProc(objConn)
urlOut2=urlOut2 & "&ReportProc=" & ReportProcName 'ReportProc(objConn)
urlOut2=urlOut2 & "&txtSOEID=" & SOEID
urlOut2=urlOut2 & "&RadioButton2=" & Request.Form("RadioButton2") & " "
%>
<form name="form1" method="post" action="<%=urlOut %>" id="Form1" />
<input name="Export" type="button" class="ButtonStyle3" value="Export"
tabindex="18" onclick="ExportReport('<%=urlOut2 %>')" />




***** What is in VBScript/CREGReports002.vbs****
Sub ExportReport(urlIn)
Dim url,w1,h1
Dim TempRadioButton1
'TempRadioButton1 = Request.Form("RadioButton1")

'TempRadioButton1 =
form1.elements.item(document.form1.RadioButton1).value
'TempRadioButton1 = document.form1.RadioButton1
' If Request.form("RadioButton1")="1" Then
' TempRadioButton1 = 1
' Else
' TempRadioButton1 = 2
' End If
'
' MsgBox (TempRadioButton1)

url=url & urlIn
url=url & "&txtAsOfDate=" & form1.txtAsOfDate.value
url=url & "&cmbCloser=" & form1.cmbCloser.value
url=url & "&cmbActionType=" & form1.cmbActionType.value
url=url & "&cmbOffice=" & form1.cmbOffice.value
url=url & "&cmbOfficer=" & form1.cmbOfficer.value
url=url & "&cmbRegion=" & form1.cmbRegion.value
url=url & "&cmbUnderwriter=" & form1.cmbUnderwriter.value
url=url & "&cmbField1=" & form1.cmbField1.value
url=url & "&cmbField2=" & form1.cmbField2.value
url=url & "&cmbField3=" & form1.cmbField3.value
url=url & "&cmbField4=" & form1.cmbField4.value
' url=url & "&RadioButton1=" & document.form1.RadioButton1
'url=url & "&RadioButton2=" & form1.RadioButton2.value
'url=url & "&RadioButton3=" & form1.RadioButton3.value
'url=url & "&RadioButton4=" & form1.RadioButton4.value

'url = "ExcelOut.asp"
MsgBox url

w1 = screen.availWidth-5
h1 = screen.availHeight-5

Dim sName,sFeatures

sName = " "
sFeatures = "top=0, left=0, height=" & h1 & ", width=" & w1
&",scrollbars=1"

'Window.navigate url ,sName, sFeatures
End Sub

Hope this is clear enough to help me out.
 
J

Jeff Cochran

How do I capture the radio button
setting without submitting the form?

In ASP you can't. Until you submit, nothing is sent to the server to
be processed. Probably can do it multiple ways in client-side code,
try a client-side group such as a Javascript group.
What is the syntax to capture the value
from the radio button?

Again, client side, unless you mean get the radio button response from
the from, which would depend on you using a POST or GET. In which
case you'd use Request.Form or Request.Querystring respectively.

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top