Jump to content
Server Maintenance This Week. ×

Problem with -Delete


This topic is 8683 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am having a problem with the -Delete Tag.

I have a shopping cart application that has a format called "view cart" which allows a user to view all items in their cart. Also, in this view, they can delete individual items. The problem is, when they click to delete one item, another item may be deleted instead. I think that the -delete tag is picking up the wrong CurrentRecordID tag but I am not sure if this is the case, nor do I know how to fix it.

Also, is there a way to combine actions on a submit button? When the user clicks the delete button, I think I need to re-perform the find and refresh the browser to reflect the current items in the cart. Is there a way to combine the -delete and -find tags?

Link to comment
Share on other sites

I know of no way to combine the two tags. The solution I have used is use one tag (in the <form>...</form> instruction) and <input type="hidden" name="-script" value="scriptname"> and write a script to cause a delete after the -find (or vice versa if that is what meets your needs.

Sometimes these scripts are easy and straight-forward, and sometimes you will spend hours, even days, getting them right. It depends on what you are trying to accomplish. Good Luck.

Peace

Keith M. Davie

Link to comment
Share on other sites

  • 1 month later...
  • Newbies

while we're on the subject of deletes...again, following the examples provided by FileMaker, i included a Javascript confirm command with the delete button and have found that the record is deleted whether i click OK or Cancel. a lot of good that confirm dialog does, huh?

does anyone know to cancel a delete action through a dialog box? thanks.

[This message has been edited by wayking (edited July 19, 2000).]

[This message has been edited by wayking (edited July 19, 2000).]

Link to comment
Share on other sites

Well, I found that they problem is cleared up when I reference the current rec id with the delete button. The cart automatically refreshes when I use the correct method to do this, thus eliminating the need to combine with the find tag.

As far as the Javascript to confirm, how about this... Use a general tag other than delete (such as find all or something) for your button and upon confirmation of delete, THEN have the javascript prompt filemaker to delete the record. I use this same method without the javascript. For instance the button that says delete is really just a "find this item" button. Therefore it shows up by itself on the next page. On that page, the button that says to confirm the delete is the real delete button and the button that says nevermind will re-find all the items and show them together again. Hope this helps. smile.gif

Link to comment
Share on other sites

  • 2 weeks later...

quote:

Originally posted by wayking:

while we're on the subject of deletes...again, following the examples provided by FileMaker, i included a Javascript confirm command with the delete button and have found that the record is deleted whether i click OK or Cancel. a lot of good that confirm dialog does, huh?

does anyone know to cancel a delete action through a dialog box? thanks.

I have used the following on my edit/delete current record page with success:

code:


<INPUT TYPE="Submit" NAME="-delete" VALUE="Delete Record" onClick="return confirm('Really delete this record?')">

Clicking on OK loads a confirmation message that the record was deleted. Clicking on Cancel closes the dialog box and the current record is still displayed.

Link to comment
Share on other sites

This topic is 8683 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.