java script confirm box

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
nebujacob2000Asked:
Who is Participating?
 
sajuksCommented:
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
 
sajuksCommented:
if its IE only, you can use vbscript
rsp = MsgBox("Are you sure?",vbyesno,"Question")
0
 
sumanrajCommented:
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
FahdmurtazaCommented:
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
 
deepaknetCommented:
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
 
FahdmurtazaCommented:
Impracticle problem I think so !
Well I think author should reply what he wants now.
Regards,
Fahd Murtaza
0
 
sajuksCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.