Connecting Tech Pros Worldwide Forums | Help | Site Map

Simple Confirmation Code for a Delete Button

Les Juby
Guest
 
Posts: n/a
#1: Aug 4 '05
I've used a simple javascript for some time (no entries required up in
the <head> tag) that asks for a confirmation before deleting.

ie.
<a href="/delete.asp?which=345 %>" onclick="javascript:return
confirm('Are you ABSOLUTELY SURE you want to DELETE this record
?')">Delete record</a>

On several sites I use short form constructs to generate a more
recognizable button, and would like to use a simple script such as
this to give the conformation option.

ie.
<form action="delete2.asp" method="post">
<input type="hidden" name="which2" value=345">
<input type="submit" value="Delete">

Could this script be modified.?

Any alternative.?

.les.


Les Juby
Guest
 
Posts: n/a
#2: Aug 4 '05

re: Simple Confirmation Code for a Delete Button


On Thu, 04 Aug 2005 04:53:07 GMT, lesjuby@anti-spam.iafrica.com (Les
Juby) wrote:
[color=blue]
> onclick="javascript:return
>confirm('Are you ABSOLUTELY SURE you want to DELETE this record
>?')"[/color]

OK. I worked it out......

onclick gets replaced by onsubmit !!!!

.les.

Phat G5 (G3)
Guest
 
Posts: n/a
#3: Aug 5 '05

re: Simple Confirmation Code for a Delete Button


in article 42f19cd9.1714768@news.telkomsa.net, Les Juby at
lesjuby@anti-spam.iafrica.com wrote on 8/3/05 9:53 PM:
[color=blue]
> I've used a simple javascript for some time (no entries required up in
> the <head> tag) that asks for a confirmation before deleting.
>
> ie.
> <a href="/delete.asp?which=345 %>" onclick="javascript:return
> confirm('Are you ABSOLUTELY SURE you want to DELETE this record
> ?')">Delete record</a>
>
> On several sites I use short form constructs to generate a more
> recognizable button, and would like to use a simple script such as
> this to give the conformation option.
>
> ie.
> <form action="delete2.asp" method="post">
> <input type="hidden" name="which2" value=345">
> <input type="submit" value="Delete">
>
> Could this script be modified.?
>
> Any alternative.?
>
> .les.
>[/color]
Sure it could.

Either

<form action="delete2.asp" method="post" onsubmit="return confirm('Are you
ABSOLUTELY SURE you want to DELETE this record ?');">

OR

<input type="submit" value="Delete"onclick="javascript:return
confirm('Are you ABSOLUTELY SURE you want to DELETE this record ?')">


HTH,

--Steffan

Closed Thread