running scrip after the page is rendered.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ed

    running scrip after the page is rendered.

    Don't know where else to ask this question...AFS people tell me they
    can't answer JavaScript questions...it' s a little of both with vbscript
    mixed in.

    I have a series of select statements such as this one that gets it's
    options from our database. At the end of the select statment(s) is a
    script to create another row of select statements so a person needing
    more than one account to process an order can do just that. Problem is I
    can't run the sql script again after they click the "Add Account" so I'm
    stuck just offering them a text boxes instead of select statements for
    each additional Account they want to add...anyone know a way around this?

    I need to build a select statment from a sql statement after the page
    has been rendered.

    sSQL2 = "SELECT DISTINCT Fund" & _
    " FROM MasterTableCfoa pal2"
    set rs2 = Connect2.Execut e(sSQL2)

    <html>
    <head>
    function addacc(num) {
    var del1 = document.getEle mentById(num)
    var stuff;
    var arow = num * (-1);
    document.RFO.ar ow.value=arow;
    document.all.Ac cAmt.style.visi bility="visible ";
    document.all.Ac cTot.style.visi bility="visible ";
    document.RFO.ac c_tot_1.value=" Balance";
    document.RFO.ac c_tot_1.disable d="true";

    stuff = "<select name=\"fund_1\" class=\"regSoft \">";
    stuff = stuff + "<% Do until rs2.eof %>";
    stuff = stuff + "<option><%=rs2 (\"Fund\")%></option>";
    stuff = stuff + "<% rs2.MoveNext";
    stuff = stuff + "Loop %>";
    stuff = stuff + "</select>";

    num = num - 1;

    stuff = stuff + "<div id=\"" + num + "\" style=\"visibil ty:visible\">"
    stuff = stuff + "<A onClick=\"javas cript:addacc(" + num +")\"><u
    class=\"regSoft \"><font color=\"blue\"> Add Account</font></u></a></div>"
    del1.innerHTML = stuff
    }
    </head>
    <body>
    <select name="fund_1" class="regSoft" >
    <% Do until rs2.eof %>
    <option><%=rs2( "Fund")%></option>
    <% rs2.MoveNext
    Loop %>
    </select>

    <div id="-2" style="visibili ty:visible">
    <a onClick=javascr ipt:addacc(-2)><u class="regSoft" ><font
    color="blue">Ad d Account</font></u></a> </div>

  • Da Costa Gomez

    #2
    Re: running scrip after the page is rendered.

    Maybe you can have a look at thread: Frames, windows, functions & onload

    Basically allows actions to take place AFTER a page has rendered.

    Cheers,
    Fermin DCG

    Ed wrote:[color=blue]
    > Don't know where else to ask this question...AFS people tell me they
    > can't answer JavaScript questions...it' s a little of both with vbscript
    > mixed in.
    >
    > I have a series of select statements such as this one that gets it's
    > options from our database. At the end of the select statment(s) is a
    > script to create another row of select statements so a person needing
    > more than one account to process an order can do just that. Problem is I
    > can't run the sql script again after they click the "Add Account" so I'm
    > stuck just offering them a text boxes instead of select statements for
    > each additional Account they want to add...anyone know a way around this?
    >
    > I need to build a select statment from a sql statement after the page
    > has been rendered.
    >
    > sSQL2 = "SELECT DISTINCT Fund" & _
    > " FROM MasterTableCfoa pal2"
    > set rs2 = Connect2.Execut e(sSQL2)
    >
    > <html>
    > <head>
    > function addacc(num) {
    > var del1 = document.getEle mentById(num)
    > var stuff;
    > var arow = num * (-1);
    > document.RFO.ar ow.value=arow;
    > document.all.Ac cAmt.style.visi bility="visible ";
    > document.all.Ac cTot.style.visi bility="visible ";
    > document.RFO.ac c_tot_1.value=" Balance";
    > document.RFO.ac c_tot_1.disable d="true";
    >
    > stuff = "<select name=\"fund_1\" class=\"regSoft \">";
    > stuff = stuff + "<% Do until rs2.eof %>";
    > stuff = stuff + "<option><%=rs2 (\"Fund\")%></option>";
    > stuff = stuff + "<% rs2.MoveNext";
    > stuff = stuff + "Loop %>";
    > stuff = stuff + "</select>";
    >
    > num = num - 1;
    >
    > stuff = stuff + "<div id=\"" + num + "\" style=\"visibil ty:visible\">"
    > stuff = stuff + "<A onClick=\"javas cript:addacc(" + num +")\"><u
    > class=\"regSoft \"><font color=\"blue\"> Add Account</font></u></a></div>"
    > del1.innerHTML = stuff
    > }
    > </head>
    > <body>
    > <select name="fund_1" class="regSoft" >
    > <% Do until rs2.eof %>
    > <option><%=rs2( "Fund")%></option>
    > <% rs2.MoveNext
    > Loop %>
    > </select>
    >
    > <div id="-2" style="visibili ty:visible">
    > <a onClick=javascr ipt:addacc(-2)><u class="regSoft" ><font
    > color="blue">Ad d Account</font></u></a> </div>
    >[/color]

    Comment

    Working...