Hi,
I have a page with few push buttons. The search opens a result page for the user to confirm the selection. But my problem is with the “Save” button. It supposed to take the changes from the boxes on the page and update the database. I have hard time getting it to save. I am using the code below but it opens the search result screen without saving the changes.
If request.Form("Submit") = "pSave" then
lId =request.form("txtProdId")
lName = request.form("txtName")
response.Write(lName)
if lName <> "" and lId > 0 then
SqlStr = "UPDATE Product SET Product_Name ='" & lName & "' WHERE Product_Id =" & lId & ";"
MyConn.Execute (SqlStr),,1
response.Write(SqlStr)
end if
end if
This is the save button:
<input name="pSave" type="reset" id="pSave" value="Save" onClick="">
This is the search button:
<input name="pSearch" type="submit" id="pSearch" value="Search" onClick="">
Thanks for your help.
Mo
I have a page with few push buttons. The search opens a result page for the user to confirm the selection. But my problem is with the “Save” button. It supposed to take the changes from the boxes on the page and update the database. I have hard time getting it to save. I am using the code below but it opens the search result screen without saving the changes.
If request.Form("Submit") = "pSave" then
lId =request.form("txtProdId")
lName = request.form("txtName")
response.Write(lName)
if lName <> "" and lId > 0 then
SqlStr = "UPDATE Product SET Product_Name ='" & lName & "' WHERE Product_Id =" & lId & ";"
MyConn.Execute (SqlStr),,1
response.Write(SqlStr)
end if
end if
This is the save button:
<input name="pSave" type="reset" id="pSave" value="Save" onClick="">
This is the search button:
<input name="pSearch" type="submit" id="pSearch" value="Search" onClick="">
Thanks for your help.
Mo