close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Delete Summary and Detail Records

Thread began 6/21/2011 3:17 am by enquiry272230 | Last modified 6/24/2011 11:18 am by Jason Byrnes | 2419 views | 8 replies |

enquiry272230

Delete Summary and Detail Records

I have set up an order history list based on eCart's orders and order details tables.

I would like to place a delete button on the orders list in the repeat region.

I would like to delete the order details by order number automatically when I delete the order.

I have searched the documentation and forums and can not find a reference for this.

ADDT used to have a "delete detail records" behaviour, which I previously used.

If someone could put me on track, it would be appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

in the repeat region, add a form with a submit button and a hidden form element to pass the order ID, the code will look something like:

php:
<form id="form1_<?php echo $row_RecordsetName['OrderID']; ?>" name="form1" method="post"  action="">

  <input name="orderID" type="hidden" id="orderID_" value="<?php echo $row_RecordsetName['OrderID']; ?>" />
  <label>
    <input type="submit" name="submit" id="submit_<?php echo $row_RecordsetName['OrderID']; ?>" value="Submit" />
  </label>
</form>




then add a delete record behavior for the orders table, set the ID column to the orderID column and the variable to use the orderID form element.

add a second delete record behavior for the order details table, set the ID column to the detailOrderID column and use the same orderID form element.

Sign in to reply to this post

enquiry272230

Ok, thanks very much, makes perfect sense.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

enquiry272230

Hi, the method of deleting works well, but I'm having trouble with a confirm javascript to help prevent accidental deletes.

Tried this:

<script type="text/javascript">
function confirmSubmit()
{
var agree=confirm("Are you sure you want to delete?");
if (agree)
return true ;
else
return false ;
}
</script>

And on the submit button:
<input type="submit" name="submit" id="submit_<?php echo $row_rs_orderHistory['OrderID']; ?>" value="Delete" onclick="confirmSubmit()" />

My problem is that if you click "No" on the dialog, it still deletes.

Also tried an inline version
onclick="confirm('Are you sure you want to delete?');"

I searched the forum but cannot find anything that will work.

Any ideas?

Sign in to reply to this post

enquiry272230

Think I have it sorted.

Using: onclick="javascript: return confirm('Are you SURE you wish to update?');"

on the submit button.

That works, selecting "Cancel" on the dialog does not activate the delete function

There must be error in the original javascript function obtained from this forum, because the delete function activated even though "Cancel" was selected.

Sign in to reply to this post

Jason ByrnesWebAssist

for the original script to work, the onlick is missing the return key word:

instead of:
onclick="confirmSubmit()"


it should be:
onclick="return confirmSubmit()"

Sign in to reply to this post

enquiry272230

Thanks for your help

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...