HighDots Forums  

Dreamweaver Server Behaviours

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Dreamweaver Server Behaviours in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
orange22
 
Posts: n/a

Default Dreamweaver Server Behaviours - 11-11-2004 , 11:52 AM






Hi, I am building a content management system with php/mysql and apache using
DW. I am now at the stage of deleting records from my database. What is
happening is that when I create the delete record server behaviour, and chose
'Form Variable' from the drop menu, press ok, and go back in, it goes straight
back to 'primary key value' every time. The problem with this is that every
time I try to select a record to delete from my form first, it deletes the
record and does not go straight to my form to check if 'you are sure you want
to delete this record'? If it is any help, I am following the practical web
projects tutorial managing content with a database. This is the one about the
band 'Circa'. I believe this issue is now sold out. Has anyone followed this
tutorial and succesfully been able to check first before you delete a record.
If so I would like to know how you did it because it fails for me every time.
What I can do is delete a record from the list of records I have in my
database, but not check first then delete. Any help anyone? Thank you Dmlocke


Reply With Quote
  #2  
Old   
Tron
 
Posts: n/a

Default Re: Dreamweaver Server Behaviours - 11-11-2004 , 12:10 PM






orange22 wrote:
Quote:
Hi, I am building a content management system with php/mysql and apache using
DW. I am now at the stage of deleting records from my database. What is
happening is that when I create the delete record server behaviour, and chose
'Form Variable' from the drop menu, press ok, and go back in, it goes straight
back to 'primary key value' every time. The problem with this is that every
time I try to select a record to delete from my form first, it deletes the
record and does not go straight to my form to check if 'you are sure you want
to delete this record'? If it is any help, I am following the practical web
projects tutorial managing content with a database. This is the one about the
band 'Circa'. I believe this issue is now sold out. Has anyone followed this
tutorial and succesfully been able to check first before you delete a record.
If so I would like to know how you did it because it fails for me every time.
What I can do is delete a record from the list of records I have in my
database, but not check first then delete. Any help anyone? Thank you Dmlocke

What exactly is supposed to happen when you click on the "delete" link?
If you want it to verify before deleting, the easiest thing to do is
creating a delete.php page. Just pass your ID value to that page. Make
the page say "Warning! You are about to Delete [recordname]. Are you
sure you want to do this? Click Delete to Delete; click back to go back."

From here, you insert your delete record command on the Delete Button.

But I don't have the issue you have, so I'm not sure what your "You sure
you want to delete this record?" is supposed to be. It could also be in
the form of a Javascript dialog box, and with that I cannot help.

If you want to see a step-by-step of what I just described, go to the
Tutorials Section of this site
(http://www.macromedia.com/devnet/mx/dreamweaver/php.html) and check out
the "build a blog" tutorial. Specifically part 2, section 11: deleting
an article.


Reply With Quote
  #3  
Old   
orange22
 
Posts: n/a

Default Re: Dreamweaver Server Behaviours - 11-11-2004 , 01:08 PM



Hi, Thanks for getting back to me. I have done all the things you have said -
the delete record server behaviour is not working because when I select the
record by clicking on the its radio button and press submit, it goes to my
delete page where my delete record server behaviour is. When I have agreed
that I want to delete this record, it doesn't do it and goes to the page I
specified in the action field. Cheers


Reply With Quote
  #4  
Old   
Tron
 
Posts: n/a

Default Re: Dreamweaver Server Behaviours - 11-11-2004 , 06:06 PM



orange22 wrote:
Quote:
Hi, Thanks for getting back to me. I have done all the things you have said -
the delete record server behaviour is not working because when I select the
record by clicking on the its radio button and press submit, it goes to my
delete page where my delete record server behaviour is. When I have agreed
that I want to delete this record, it doesn't do it and goes to the page I
specified in the action field. Cheers

First Question: Do you know that it is the right article that you are
trying to delete? You have passed your unique key to the page, so the
only record showing up should be the one. I'll assume that the problem
lies on the delete page, but I just wanted to make sure. Your link to
the Delete Page should look like this:
../delete_art.php?id_art=<?php echo $row_rsAdminArticles['id_art']; ?>

Sounds like you've got it right, though.

Go to your delete page (here it's delete_art.php) Check your delete
record server behaviour. The most common place for this to fall apart is
at the first step:

First Check if variable is defined: This will be the button name (not
the label) of the Delete Button. When in doubt, give button name and
label the same name. Code looks like this:

<form action="delete_art.php" method="post" name="delete" id="delete">
<input name="yes" type="submit" id="yes" value="Delete">
<input name="id_art" type="hidden" id="id_art" value="<?php echo
$row_rsDeletedArticle['id_art']; ?>">
</form>

In this case, my Variable is "Yes", not "Delete".

Your primary Key Column and Primary Key Value have to match. Your
primary key (in the example above) is a hidden value.

After that, don't know what else to say without seeing the code....


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.