logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Video Tutorials
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 11-21-2006, 06:02 PM   #1
lux
 
Join Date: Apr 2006
Posts: 313
Default Deleting a record

Hey davidj,

I use text instead of buttons in my forms when deleting a record from a database table and use this javascript to open a diolog box to confirm the users choice.

onclick="return confirm('Are you sure you want to delete?')

It is very simple and helps when users accidently click on the wrong delete text.

Would this work in your example where your using a button instead of text as you already use onClick for a different purpose?
__________________
"i was going to say that!" - davidj 2008

Last edited by lux; 11-22-2006 at 05:52 AM..
lux is offline   Reply With Quote
Old 11-21-2006, 06:33 PM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

of course

just replace the button with the text

what i would do is create a function to call

example...

Code:
 
function del(){
 
y = confirm("message is true");
 
   if (y){
 
   document.location.href='delete.php?del=1';
 
   }
 
}
then wrap your delete statement in an IF


Code:
 
if($_GET['del']){
 
*** delete statement here ***
 
}
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk

Last edited by davidj; 11-21-2006 at 06:45 PM..
davidj is offline   Reply With Quote
Old 11-21-2006, 08:50 PM   #3
lux
 
Join Date: Apr 2006
Posts: 313
Default

yeah cool,

cheers for that
__________________
"i was going to say that!" - davidj 2008
lux is offline   Reply With Quote
Old 11-21-2006, 08:52 PM   #4
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

working your last problem now!!!!!

its a doosy
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 11-21-2006, 09:58 PM   #5
lux
 
Join Date: Apr 2006
Posts: 313
Default

hehe,

while i have been working on other things ive been looking at it too! ahhhhh
__________________
"i was going to say that!" - davidj 2008
lux is offline   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

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

Forum Jump


All times are GMT. The time now is 06:28 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com