SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2001
    0 Post(s)
    0 Thread(s)

    How do I get JavaScript and ASP to work together on this?

    HELP! This is driving me crazy!!
    What I'm trying to do is for the user to press a button(called choose order form) to jump out to another window thru JavaScript have the user make an enty by pressing a radio button (no submit), close the remote window, bring the user back to the original window form and print a result from a database (based on the data from the remote window) underneath the button (called choose order form).

    Below is the jumping control structure I'm trying to make work

    Dim Cook1, FeeNum, state, objRSfee, strSQLfee, Fee, FormName
    call getname
    call doit

    sub getname
    response.write "<script language='javaScript'>"
    response.write "var'OrderFeeSchedule2001.html','orderfees','scrollbars=yes,toolbars=yes,width=616,height=300');"
    response.write "</script>"
    end sub

    sub doit
    'Dim Cook1, FeeNum, state
    Cook1 = request.cookies
    FeeNum = Left(cook1,2)
    'Dim objRSfee, strSQLfee, Fee, FormName
    strSQLfee = "SELECT * FROM fees WHERE form_number Like '" & FeeNum &"'"
    set objRSfee = Server.CreateObject("ADODB.Recordset")
    objRSfee.Open strSQLfee,objConn,adOpenStatic,adLockReadOnly, adCmdText
    If objRSfee.EOF Then
    Fee = ""
    FormName = ""
    Fee = objRSfee("form_cost")
    FormName = objRSfee("form_name")
    End If
    end sub

    <%Response.Write " "&FormName%>

    I also posted this on the client development area.

  2. #2
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    United States
    0 Post(s)
    0 Thread(s)
    Why not use VBScript on the Server-Side and JavaScript on the Client-Side? It would make things much easier to differentiate, and VBScript's easier with ASP than JavaScript is.

    Otherwise, my suggestion is: Make a flow chart. Map it out, put it on paper. Then, code for every step. Just read the ideas from the flow of logic on your paper and script them one at a time. Always seems to work out kinks in my code that I have.

    Good luck. Sorry I couldn't be of more help. Maybe if you explained more I could offer some more information.

    'Till next time..
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  3. #3
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Muskegon, MI
    0 Post(s)
    0 Thread(s)
    I believe he is using VBScript on the server and javascript on the client.

    You're on track, but when you select a button on the second window and jump back to the first, you'll need to pass a form or query string value and reload the first page so that ASP can access it.

    Also, it's not neccassary andless confusing to not use ASP to write out your JavaScript.

    VBScript - ASP code
    code goes here
    Smart Web Solutions for Smart Clients


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts