PDA

View Full Version : Trying to seperate out the content1+ Fields



dan18088
10-19-2003, 03:09 AM
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>';"

%>

raf
10-19-2003, 10:36 AM
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


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")