Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2002
    Location
    Charlotte
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Trying to seperate out the content1+ Fields

    Any idea's on how I can get the data between the # signs into a variable so it can be posted to another page and written to a SQL database?

    <Script>

    var rowsAlreadyDone = new Array(100); // arbitrary size


    var ELpntr=1;

    function NewRow(rownum)
    {
    if ( rowsAlreadyDone[rownum] == "DONE" ) return; // just ignore the request
    rowsAlreadyDone[rownum] = "DONE";


    ELpntr++;

    var content1='';

    content1='<select name="SalesStaff'+ELpntr+'" onChange="NewRow('+ELpntr+')">';

    <% set conntemp=server.createobject("adodb.connection")
    conntemp.open

    SQL="Select emppers.*,empcomp.* from (Emppers Inner Join Empcomp ON(empcomp.EecEmplStatus <>'T' AND EecOrglvl1 like '%SAL%' AND emppers.eepeeid=empcomp.eeceeid)) order by eepnamelast"
    set rstemp=conntemp.execute(SQL)

    Response.write "content1+='<option value=""""></option>';" & vbcrlf

    'This loop creates all the options
    do until rstemp.eof
    sFullName = Trim(rstemp("eepnamelast")) & "_" & Trim(rstemp("eepnamefirst"))
    sFullName = Replace(sFullName,"'", " ")
    sFirstName = Trim(rstemp("eepnamefirst"))
    sFirstName = Replace(sFirstName,"'", " ")
    sLastName = Trim(rstemp("eepnamelast"))
    sLastName = Replace(sLastName,"'", " ")
    sEmployeeID = Trim(rstemp("eepeeid"))
    sID = Trim(rstemp("EecEmpNo"))
    sDepartment = Trim(rstemp("EecOrglvl1"))
    sRegion = Trim(rstemp("EecOrglvl2"))
    sStatus = Trim(rstemp("EecFullTimeOrPartTime"))


    Response.Write "content1+='<option Value="""& "#" & sEmployeeID & "#" & sFirstName & "#" & sLastName & "#" & sID & "#" & sDepartment & "#" & sRegion & "#" & sStatus & """>" & sFullName & "</option>';" & vbcrlf

    rstemp.movenext

    Loop

    rstemp.close
    conntemp.close

    'This closes the select list
    Response.write "content1+='</select></td>';"

    %>

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't quite understand it. The data between the # is already in a variable. And why post it to another page ? It's data from a selectquery, so you can run the selectquery in that other page ...

    Anyway. One possibility is to use response.redirect. Like
    Code:
    dim url
    url ="thepage.asp?semployeeID=" &  sEmployeeID & "&FirstName="  & sFirstName
    response.redirect(url)
    (and so on for all variables you need)

    Then inside thepage.asp, you can get the values with
    request.querystring("semployeeID")


  •  

    Posting Permissions

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