/    Sign up×
Community /Pin to ProfileBookmark

Confirm delete alert – needs 2b specific to delete button

I have an alert button to confirm deletion of a record but it comes into action when any button on the form is pressed (because the code that calls the function is in the form tag) how can I alter the code so that it only appears when the delete button is pressed???

Cheers

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Aug 10.2005 — Add it to the button:

onclick="return confirm('Are you sure?');"

Eric
Copy linkTweet thisAlerts:
@sky_hereAug 11.2005 — helo..hmm..im quite new to this javascript..i wanna ask something..im doing a delete button..same matters with funkymonkey..i had add the onclick="return confirm('Are you sure?');"

and luckily it works ?

thanx but can u help me how to ensure that the button will delete datafrom database..im quite blur
Copy linkTweet thisAlerts:
@FunkymonkeyauthorAug 11.2005 — Hia I already tried that the problem is that my button is not just a HTML button it is as asp:button.

Error is 'return' is not a member of 'ASP.deletefaq_aspx'

The problem is that asp and JS don't seem to be compatitble, probably as one is server-side and the other is client-side.

Any ideas on solving this problem?
×

Success!

Help @Funkymonkey spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...