|
| |
|
|
JeroenDortmans
Posts: 66 From: Eindhoven Netherlands Status: offline
|
Update and delete function in one form - 3/21/2002 8:46:31
Hi, I have a form with text fields which I use to update a table in a Access database. With the "submit" button in this form, named update, I send the form to an update page where a query updates the database. Now I also have a delete page with a delete query which I want to activate from the same form. So I have an update and a delete button included in this form. I can send the form information to the update query with the "standard" submit button, but I have to add a new button for sending the form information to the delete page. I made a VBS to test this. This script displays a confirm box and sends the "bedrijf_ID" to the same update page I used for the update button. The update page updates all fields with this "bedrijf_ID". It works fine with the "submit" button, but doesn't work for the "delete" button. How can I make this work? And is it also possible to run an update script on the same page as the form is? Here is the script. <script language="VBscript"> Sub delete_onClick returnvalue=MsgBox ("Weet je zeker dat je deze record wilt verwijderen?. Proceed?",52,"Delete record!") If returnvalue=6 Then window.location="Relaties_update.asp?bedrijf_ID=<%=FP_FieldURL(fp_rs,"bedrijf_ID")%>" End If End Sub </script> <input type="button" value="Relatie verwijderen" name="delete" style="font-size: 10 px; font-weight: bold">
|
|
|
|
davebukouricz
Posts: 300 From: Ma None Status: offline
|
RE: Update and delete function in one form - 3/21/2002 19:57:11
Actually you could do them both on the same page by testing for the button... Case delete then Delete whatever from your table where ID="&id"' Else Update whatever in your table where ID="&ID&" the syntax is a little more involved, but that's the basic idea. <%Do While still looking down at the grass instead of up at the roots%> Dave
|
|
|
|
kmc
Posts: 108 Joined: 3/8/2002 From: Status: offline
|
RE: Update and delete function in one form - 3/25/2002 15:14:25
May I ask you how you set up your update and delete form. I am new to this and that is what I need for my website.
|
|
|
|
JeroenDortmans
Posts: 66 From: Eindhoven Netherlands Status: offline
|
RE: Update and delete function in one form - 3/25/2002 18:12:32
Use the DRW to build a form. At the end of the DRW you must specify that you want text fields to display your database values in. Now you are able to display the database values in the form. Make a update page with a update query. How to set up a update query you can find in the spooky FAQ http://www.outfront.net/spooky/update.htm. Now you click in the form on the submit button with the right mouse button. Click on the “form properties”. In the window click on “options”. In the window you can type the file name of your update page in the field “Action”. This is your update part. First try this. When you have more questions, just ask me. Let me know when this works. Then I will explain you how to build the delete part within the same form. Edited by - JeroenDortmans on 03/25/2002 18:15:47
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|