473,785 Members | 3,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DHTML confirm delete

62 New Member
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_de l=name_del'oncl ick=\"displayMe ssage('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 2520
JosAH
11,448 Recognized Expert MVP
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 New Member
yes pleas do anything to solve this problem :-)
Aug 17 '07 #3
JosAH
11,448 Recognized Expert MVP
yes pleas do anything to solve this problem :-)
Your question was moved; success.

kind regards,

Jos
Aug 18 '07 #4
acoder
16,027 Recognized Expert Moderator MVP
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 New Member
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
10118
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 javascript as an enhancement and not a requirement to work. My question is can I have the html form function normally if the user has javascript
2
2840
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 problems with the font used to present messages in alert, prompts and confirm dialogs. If I for examle paste a chinese value in a prompt dialog it is shown om my machine as a vertical bar. When I write the value back to a textbox <input type="text"...
1
2651
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 Page_Load(object sender, System.EventArgs e) { if(! Page.IsPostBack)
2
1514
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 is laid out like this :- Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand 'edit from datagrid
7
2024
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) RegisterClientScriptBlock("CSP-showconfirm-function", _ "<s"+"cript language=""JavaScript"">" & vbCrLf & _
3
3829
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
10025
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" and a "delete" node. I have the functionality of the edit and delete working fine, my issue is now however that I cannot seem to find a way to add an "onclick" event that fires a confirm box. I've tried this method.. treenode.Text = "<a...
8
14689
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 href="vehicle_history_delete.php?history_id=18&vehicle_id=5" onclick="return DelAlert();"><img border=0 src="/images/delete_category_16.gif" alt="Delete This record" title="Delete this record">
4
7503
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 checkchekboxes and click the Delete button. That will show a confirmation dialog message with the items they choose to delete.
0
10319
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10087
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.