473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Radio Button Capture Setting In VB

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).v alue
'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.
--
Jim Quast
Jul 21 '05 #1
1 4305
On Wed, 10 Nov 2004 12:19:06 -0800, Jim Quast
<Ji******@discussions.microsoft.com> wrote:
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
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: JR | last post by:
Hi. I hope someone out there who is more versed with JavaScript than I can help me with the following annoying problem. Here's the problem. I have a form with the following layout: Column A...
4
by: Jared | last post by:
Radio Button or Check Box and Event Procedures I need to insert either radio buttons or check boxes onto my form. I'm not sure which to use, or if there are other options. I am using the buttons...
2
by: tshad | last post by:
I have 2 radio buttons: <asp:RadioButton ID="radDetail" GroupName="detailSummary" Text="Detail" checkedChanged="RadDetail_Clicked" runat="server" /> <asp:RadioButton ID="radSummary"...
0
by: Shadow Lynx | last post by:
In standard HTML, the <INPUT type="radio" name="x" /control only allows one radio button to be checked at a time. When more than one are set as checked="true" then only the last one rendered...
1
by: Shane | last post by:
I think that I found a bug in the Radio Button, and I wanted to give everybody a "Heads Up". I spent three days doing trial and error until I found a work around. I created a user control with a...
1
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
7
by: IchBin | last post by:
I am trying to programmatically set a radio button in a table of radio buttons. I have two problems with the code below: 1 - I can not prepare the <Formstatement to be printed by php. (syntax...
3
by: teddysnips | last post by:
Back in the dim mists of antiquity I used to program in VBA for Microsoft Access (hey, don't knock it - very useful tool for the right application). This had a really handy control in the...
4
by: liltwese | last post by:
Hi, i'm new to VB. I have a problem with de-selecting radio buttons in group box containers. I've tried to set focus to other objects under Sub New (initialization) but it didn't work. The rdo...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.