Radio Button Capture Setting In VB

Discussion in 'ASP General' started by Jim Quast, Nov 10, 2004.

  1. Jim Quast

    Jim Quast Guest

    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.
    --
    Jim Quast
    Jim Quast, Nov 10, 2004
    #1
    1. Advertising

  2. Jim Quast

    Jeff Cochran Guest

    On Wed, 10 Nov 2004 12:19:06 -0800, Jim Quast
    <> 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
    Jeff Cochran, Nov 11, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    697
    Eliyahu Goldin
    Feb 2, 2005
  2. Scott D Johnson
    Replies:
    1
    Views:
    1,046
    Scott D Johnson
    Sep 27, 2006
  3. RisingFish
    Replies:
    0
    Views:
    375
    RisingFish
    Oct 10, 2006
  4. Hiten
    Replies:
    1
    Views:
    608
    Vidar Petursson
    May 26, 2004
  5. Terry Murray

    Setting focus on radio button

    Terry Murray, Sep 25, 2003, in forum: Javascript
    Replies:
    3
    Views:
    92
    kaeli
    Sep 25, 2003
Loading...

Share This Page