/    Sign up×
Community /Pin to ProfileBookmark

javascript confirm yes/no

Hi everyone

I need to replace Ok/Cancel buttons with Yes/No buttons in a javascript ‘confirm’ and I have absolutely no idea about how to do it…

Could anyone help me please…

to post a comment
HTML

8 Comments(s)

Copy linkTweet thisAlerts:
@WoDJul 13.2005 — I don't think this is actually possible. You could, however, try to "mock up" a Javascript confirm using DHTML, floating layers and all that jazz.
Copy linkTweet thisAlerts:
@buntineJul 13.2005 — VBScript offers that functionality. Note, it will only work in IE. ?
<i>
</i>&lt;script language="VBScript"&gt;
Dim intAnswer
intAnswer = MsgBox("do you want only YES and NO?", vbYesNoCancel)

If intAnswer = 6 Then
' Yes.
ElseIf intanswer = 7 Then
' No
Else
' Cancel
End If
&lt;/script&gt;

Regards.
Copy linkTweet thisAlerts:
@lieutenantDafauthorJul 15.2005 — Well thank you very much!!!
Copy linkTweet thisAlerts:
@buntineJul 15.2005 — No worries. ?
Copy linkTweet thisAlerts:
@jeyasreeNarayaMay 20.2008 — please send me the code for confirm box with yes/no
Copy linkTweet thisAlerts:
@jeyasreeNarayaMay 20.2008 — i need in ajvascritp code
Copy linkTweet thisAlerts:
@jeyasreeNarayaMay 20.2008 — i need code for confirm message like yes/no button using java script code..
Copy linkTweet thisAlerts:
@felgallMay 20.2008 — See http://javascript.about.com/library/blmodald1.htm for how to create modal windows with JavaScript. The example is a simple alert but you can create whatever dialog box you want by using the appropriate HTML since the JavaScript makes the dialog part of the page rather than using one of the three that the browsers supply.
×

Success!

Help @lieutenantDaf 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 5.5,
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,
)...