confirm box question

C

Craig Keightley

is there a way of changing the values of the confirm box from ok / cancel to
yes / no

i have the following alert/confirm box but it is worded in a way that the ok
and cancel do not make sense:


function confirmNewSupplierWelcome(){
return confirm(
'Before going on to request a new supplier\n'
+ 'are you sure there is no suitable alternative?'
+ '\nRemember, new suppliers are authorised by exception only'
);
}
 
M

McKirahan

Craig Keightley said:
is there a way of changing the values of the confirm box from ok / cancel to
yes / no

i have the following alert/confirm box but it is worded in a way that the ok
and cancel do not make sense:


function confirmNewSupplierWelcome(){
return confirm(
'Before going on to request a new supplier\n'
+ 'are you sure there is no suitable alternative?'
+ '\nRemember, new suppliers are authorised by exception only'
);
}
You can't change it.

The question should be phrased so those responses make sense.

For example,

Click Cancel if there is a suitable alternative;
otherwise, click OK to request a new supplier.

Remember, new suppliers are authorised by exception only.
 
I

Ivo

is there a way of changing the values of the confirm box from ok / cancel to
yes / no

No, there isn't. Sorry.
i have the following alert/confirm box but it is worded in a way that the ok
and cancel do not make sense:

You more or less provide the solution yourself: change the wording of the
question.
hth
 
C

Craig Keightley

Trust me, the question is not in my words and for an easy life, iw ould re
phrase it too (it was before, but my client is very fussy!!!)

Is there way to acheive this using VB Script?
 
J

James X. Li

You can try to use the showModalDialog() method to display your questions.

James
 
D

Dietmar Meier

Craig Keightley wrote:

[Yes/No Box]
Is there way to acheive this using VB Script?

Yes, if you target MSIE on Windows only. VBScript is not supported on
any other platform (AFAIK). See the example below. If you implement
VBScript in your documents, and have any intrinsic JavaScript (like
`<element onwhatever="jscode">´), make sure that the VBScript block is
not the first script block in your document, since MSIE ignores the
"Content-Script-Type" HTTP header equivalent and interpretes any
intrinsic script as of the type of the first script block found in the
document ...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>VB Yes No</title>
<script type="text/javascript">
function askVB(s) {
if (typeof VBYesNoQuestion != "undefined") {
return VBYesNoQuestion(s);
}
}
</script>
<script type="text/vbscript">
Public Function VBYesNoQuestion (ByVal s)
VBYesNoQuestion = MsgBox (s, 4, "Question") = 6
End Function
</script>
</head>
<body>
<a href="#"
onclick="alert(askVB('Foo Bar') + ' was returned'); return false"
test it</a>
</body>
</html>

ciao, dhgm
 
D

Dietmar Meier

Craig Keightley wrote:

[Yes/No Box]
Is there way to acheive this using VB Script?

Yes, if you target MSIE on Windows only. VBScript is not supported on
any other platform (AFAIK). See the example below. If you implement
VBScript in your documents, and have any intrinsic JavaScript (like
`<element onwhatever="jscode">´), make sure that the VBScript block is
not the first script block in your document, since MSIE ignores the
"Content-Script-Type" HTTP header equivalent and interpretes any
intrinsic script as of the type of the first script block found in the
document ...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>VB Yes No</title>
<script type="text/javascript">
function askVB(s) {
if (typeof VBYesNoQuestion != "undefined") {
return VBYesNoQuestion(s);
}
}
</script>
<script type="text/vbscript">
Public Function VBYesNoQuestion (ByVal s)
VBYesNoQuestion = MsgBox (s, 4, "Question") = 6
End Function
</script>
</head>
<body><p>
<a href="#"
onclick="alert(askVB('Foo Bar') + ' was returned'); return false"
test it</a>
</p></body>
</html>

ciao, dhgm
 
F

Fred Oz

Craig said:
Trust me, the question is not in my words and for an easy life, iw ould re
phrase it too (it was before, but my client is very fussy!!!)

Is there way to acheive this using VB Script?

You could use 'pop-up' divs that are styled to look like dialogs.
Then you can support any browser with JavaScript, rather than just
those with VBscript.

Try to make your client outcome focused: the intention is to
determine whether the user wants to request a new supplier, not get
them to say "yes" or "no".

Sticking with confirm:

Before going on to request a new supplier,
are you sure there is no suitable alternative?

Remember, new suppliers are authorised by exception only.

Click 'OK' to request a new supplier, or
click 'Cancel' to not request a new supplier.

The question is poorly worded anyway - I may not be sure, but I may
still want a new supplier. So no, I'm not sure but yes, I want a new
supplier. Hmmm.

Just suggestions...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top