Solved

java script confirm box

Posted on 2004-09-16
10
378 Views
Last Modified: 2008-02-01
Hi,
In java script in the confirm box the buttons are OK and Cancel.Is there any option to change that to Yes/No
regards
Nebu
0
Comment
Question by:nebujacob2000
10 Comments
 
LVL 33

Accepted Solution

by:
sajuks earned 50 total points
ID: 12081883
javascript doesnt have the facility to change the option.
What you can do is have something like this
<HEAD>



<SCRIPT LANGUAGE="JavaScript">
function getInfo() {
doyou = confirm("Do you want to continue? (OK = Yes   Cancel = No)");

if (doyou == true)
{

return true
}
else
{

return false
}
}
</script>
<BODY>

<form method="POST"  onSubmit ="return getInfo()">
<input type="text">
  <input type="submit" value="Submit" name="B1">
  <input type="reset" value="Reset" name="B2"></p>
</form>



</BODY>

0
 
LVL 33

Expert Comment

by:sajuks
ID: 12081900
if its IE only, you can use vbscript
rsp = MsgBox("Are you sure?",vbyesno,"Question")
0
 
LVL 1

Expert Comment

by:sumanraj
ID: 12082029
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 6

Expert Comment

by:Fahdmurtaza
ID: 12083650
Yes I think sajuks is right as javascript is object based language not whatsoever called purely object oriented like c++. But you can design something like that using css and javascript combined. I mean dhtml. Its like a popup like when it displys while emptying the junk mail folder.
Regards
Fahd Murtaza
0
 
LVL 15

Expert Comment

by:deepaknet
ID: 12099516
Hi:

JavaScript does not have this feature. VBScript, however, may allow you to declare the button captions of your choice, from the predefined enumeration set.
0
 
LVL 6

Expert Comment

by:Fahdmurtaza
ID: 12515626
Impracticle problem I think so !
Well I think author should reply what he wants now.
Regards,
Fahd Murtaza
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12520496
I've listed the available options. So i feel the question has been answered properly by me and i should be reciving the points
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now