473,396 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DHTML confirm delete

62
I have a DHTML confirm box that i will use to confirm delete the information from my page which are from database....
this is the script

[HTML] </script>
<script type="text/javascript">
function verify(ver){
if(ver){
// Confirmed message, i.e. clicked on "Yes"
alert('Message confirmed');
}else{
// Clicked on "No"
alert('Message not confirmed');
}
}
</script>
[/HTML]
how can i change this script to can delete the information from my record ?
for example the originalpage says...
[HTML]<a href ='del.phpid_del=id_del&name_del=name_del'onclick=\ "displayMessage('includes/confirm_msg.inc.php');return false\">delete</a>
[/HTML]
why after i click onn yes in the DHTML confirm bot but the record is not delete ?
Aug 17 '07 #1
5 2501
JosAH
11,448 Expert 8TB
Greetings, you posted your Javascript question in the Java Forum. Javascript and
Java have nothing to do with each other no matter their names. Do you want me
to move your question to the Javascript Forum?

kind regards,

Jos
Aug 17 '07 #2
paitoon
62
yes pleas do anything to solve this problem :-)
Aug 17 '07 #3
JosAH
11,448 Expert 8TB
yes pleas do anything to solve this problem :-)
Your question was moved; success.

kind regards,

Jos
Aug 18 '07 #4
acoder
16,027 Expert Mod 8TB
In your delete link, the onclick should return true or false. true would go to the URL that deletes and false would prevent the link being followed.

The function which calls confirm should return true or false, e.g.
Expand|Select|Wrap|Line Numbers
  1. return confirm("Are you sure you wish to delete this record?");
Aug 18 '07 #5
paitoon
62
Oh I found the way not by use this script :;

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. <!--
  3. function confirmation(ver) {  
  4.     if (ver){
  5.         window.location = "<? echo "del.php?id_del=$id_del&name_del=$name_del&id_photo=$id_photo"; ?>";
  6.     }
  7.     else{
  8.         return false;
  9.     }
  10. }/////close
  11. //-->
  12. </script>

I hope this will be use for the further question of someone.......

....But i have the new question in the page photo.php i want to delete the photo within..<?php echo $_SERVER['PHP_SELF'] ?> instead of use the delete.php page but the photo was deleted at once after i open that page without clicking submit why ? or i can not delete the photo within itself ? what should i do ?
Aug 18 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: neoconwannabe | last post by:
Hi, I have an html form with a number of checkboxes that can be checked to delete items. I want to have a javascript alert prompt box to pop up to confirm the delete. I am building my site with...
2
by: Hans | last post by:
Hi! I have an asp application where I use a lot of javascript for validations etc and as it is today I use alert, confirm and prompt dialogs. Now we are adding support for unicode and I have...
1
by: Muhammad Abdullah | last post by:
Hi am having some problems with the javascript confirm. i have it working fine on one page and it doesnt even pop up at the other. The code on the working page is, private void...
2
by: mark | last post by:
im having issues in creating a javascript confirm option on pressing a delete button in a datagrid - ive tried a few things but nothing seems to work (either crashes or does nothing) my codebehind...
7
by: TJS | last post by:
javascript "confirm" fires after deletion instead of before deletion. how do I get this to stop the processing ? code ================== Sub ShowAlert(ByVal s As string)...
3
by: ad | last post by:
I want user can confirm before delete records ? How can I show a confirm dialog when users press a button?
4
by: tfsmag | last post by:
Okay, I have a project management app i'm writing and in the left hand menu i have a treeview control that is populated with each project... in child nodes under each project node I have an "edit"...
8
by: Eric | last post by:
I have a confirm alert before the user goes to a delete page, and it doesn't matter if the user clicks ok or cancel - they always go to the delete page. I have the following code: <a...
4
by: mamun | last post by:
Hi All, I have the following situation and am looking for answer in C#. I have a datagrid and putting checkbox next to each record. In the header I have a Delete button. I want users to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.