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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two buttons on the screen.

Status
Not open for further replies.

haneen97

Programmer
Dec 10, 2002
280
0
0
US
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
 
Move the code for what you want to happen to the onClick.

What is the code you have for the actual form?

You might want to cross post this in the ASP forum.

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top