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

deleting an entry

Thread began 8/06/2012 4:25 pm by JamieEff | Last modified 8/08/2012 1:12 pm by Jason Byrnes | 951 views | 7 replies |

JamieEff

deleting an entry

Hey guys

Just had a support session with Ray, but am trying now to figure out how to be able to delete an entry.

basically, my client is able to add a company to the database but I dont know how to allow him to delete a specific entry.

At the moment my code is

<div><a href=""><?php echo $row_Clients['UserFirstName']; ?></a></div>
<div><?php echo $row_Clients['UserEmail']; ?></div>
<div style="float:left;width:185px;margin:0 0 0 4px;"><?php echo $row_Clients['UserPassword']; ?></div>
<div>
<form action="clientarea-list.php" method="delete" >
<input name="Submit" type="image" id="Submit" src="images/misc/delete.jpg" width="20" height="20" alt="Delete"/>
</form>
</div>



I think my form action (so far) is right, but I dont know how to get it to delete the entry that it is related to in the repeat region....

Cheers

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

you need to add a hidden field that will pass the ID of the record to delete.

Then in the delete record behavior, set the Key value to use the hidden element.

Sign in to reply to this post

JamieEff

sorry to be a pain and to be thick, but how do I go about doing that?

Thanks

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

well, the recordset on your page should return the ID column.

add a hidden form element to your form, and bind the initial value of the element to the ID column from the recordset.

then add a delete record behavior, in the delete record behavior, set the key column to the ID column and bind the key value to the hidden element.

Sign in to reply to this post

JamieEff

OK Jason, but I just dont know how to do that....

If you couold give me a step by step guide of how to do it and how to set it up I would really appreciate it.

Sign in to reply to this post

Jason ByrnesWebAssist

to add a hidden form element go to insert -> form -> hidden element.

to set the initial value for the hidden element, select it in design view, then in the property inspector, click the lightning bolt next to Initial Value and select the ID column from the recordset binding group.

to add a delete record behavior, open the server behaviors tab, click the plus button and select webassist -> Data Assist -> Delete -> Delete Single record.

Sign in to reply to this post

JamieEff

thanks very much Jason

Got that all working with thanks to you and to Ray...

I have added that delete function to a part of the site but when I click on delete (image 1) the resulting 'action' takes me to image 2

I then have to click back to actually see the page with the item removed...

How would I get it to do that part automaticallY

Cheers

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

Does the page take any URL Variables at run time?

if so make sure the form is passing them as part of the action.

also, make sure the delete code comes before the recordset on the page.

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...