Hi,
I am trying to trigger an update query on a click of a button. I tried few things but I hit a wall. This where I stand now.
The button:
<input name="pUpdate" type="button" id="pUpdate" value="Update" onClick="return pUpdate_Onclick()">
The function:
Function pUpdate_OnClick()
lId = trim(request.form("txtProdId"))
lName = trim(request.form("txtName"))
lCode = trim(request.form("txtCode"))
lType = trim(CLng(request.form("lstType")))
lVolume = trim(request.form("txtVolume"))
lLevel = trim(request.form("txtReOrder"))
lQty = trim(request.form("txtQtyOnHand"))
lCost = trim(request.form("txtUCost"))
lSale = trim(request.form("txtSalePrice"))
lApps = trim(request.form("txtApplications"))
lEffects = trim(request.form("txtSideEffects"))
lLocation = trim(request.form("txtLocation"))
lActive = trim(request.form("txtActiveIng"))
lSName = trim(request.form("txtScientName"))
lNotes = trim(request.form("txtNotes"))
response.Write(lName)
if lName <> "" and lId > 0 then
SqlStr = "UPDATE Product SET Product_Name ='" & lName & "' WHERE Product_Id =" & lId & ";"
MyConn.Execute (SqlStr),,1
end if
end Function
Please help!
Thanks
Mo
I am trying to trigger an update query on a click of a button. I tried few things but I hit a wall. This where I stand now.
The button:
<input name="pUpdate" type="button" id="pUpdate" value="Update" onClick="return pUpdate_Onclick()">
The function:
Function pUpdate_OnClick()
lId = trim(request.form("txtProdId"))
lName = trim(request.form("txtName"))
lCode = trim(request.form("txtCode"))
lType = trim(CLng(request.form("lstType")))
lVolume = trim(request.form("txtVolume"))
lLevel = trim(request.form("txtReOrder"))
lQty = trim(request.form("txtQtyOnHand"))
lCost = trim(request.form("txtUCost"))
lSale = trim(request.form("txtSalePrice"))
lApps = trim(request.form("txtApplications"))
lEffects = trim(request.form("txtSideEffects"))
lLocation = trim(request.form("txtLocation"))
lActive = trim(request.form("txtActiveIng"))
lSName = trim(request.form("txtScientName"))
lNotes = trim(request.form("txtNotes"))
response.Write(lName)
if lName <> "" and lId > 0 then
SqlStr = "UPDATE Product SET Product_Name ='" & lName & "' WHERE Product_Id =" & lId & ";"
MyConn.Execute (SqlStr),,1
end if
end Function
Please help!
Thanks
Mo