Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert the contents of dynamically generated textbox in a table. 2

Status
Not open for further replies.

GoldPearl

Programmer
Joined
Aug 9, 2005
Messages
64
(asp 3.0 + sql server 2K)

i want to insert the contents of dynamically generated textbox in a table.

in my first web page, a user can make a series of selection (eg select a position - let's say 'engineer').

when the user clicks the next button(next1), a table is displayed with the employeeid, duty and a blank textbox where the user can input the scores.(same format as below: user-duty-score)

after filling in the scores, the user clicks the next button(next2) to input the data in the database, but the insert statement is not doing what i want it to do. it is inserting the scores on the same line as 2,3(eg of scores) and i want it to display separately in the table as:

user1 duty1 score1
user1 duty2 score2
user1 duty3 score3
etc...

enclosed is the code for the next2 button:

Sub Next2
dim rs
dim cn
Dim sql, sql1
dim i

date1=request.form("txtdate")
per=request.form("lstper")
emp=request.form("lstemp")
pos=request.form("lstpos")
dept=request.form("lstdept")
pjt=request.form("lstpjt")
response.Write(emp)
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open(Conn)

Set rs = Server.CreateObject("ADODB.Recordset")

txtmscore = request.Form("txtmscore")
'for i = 0 to txtmscore
sql = "INSERT INTO mdutyscore (userid, mdscore) VALUES ('" & request.Form("lstemp") & "' ,'" & txtmscore & "' )"
'response.Write(sql)
'response.End()

cn.Execute(sql)
'next

end sub


anybody can help me out. it's urgent.
Tks
Gold Pearl.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top