Solved

Yes / No vs OK / Cancel

Posted on 2007-11-19
2
2,962 Views
Last Modified: 2011-09-20
lbTempTest.Attributes.Add("onClick", "return confirm('Do you want to add another Debt Item?');");

This part:

return confirm('Do you want to add another Debt Item?');


Do I have different options for this?

Can I do "Yes / No" buttons instead of "OK / Caoncel"?

How does this work?
0
Comment
Question by:Tom Knowlton
2 Comments
 
LVL 4

Assisted Solution

by:DavidTMoore
DavidTMoore earned 100 total points
ID: 20316708
Javascript confirms are browser specific and cannot be changed.  You will need to build a custom control to achieve this.

cheers
~David
0
 
LVL 16

Accepted Solution

by:
gnoon earned 400 total points
ID: 20317115
>Can I do "Yes / No" buttons instead of "OK / Caoncel"?
Yes, you can.

>How does this work?
You change to this

lbTempTest.Attributes.Add("onClick", "return (makeMsgBox('Confirm','Do you want to add another Debt Item?',2,4,0,0)==6);");

Then define the makeMsgBox function on the page
<script language=vbscript>
<!--
'Make user dialog appear
'@param title title string
'@param mess message string
'@param icon 
'	0 - no icon
'	1 - red cross
'	2 - question
'	3 - warning
'	4 - information
'@param buts
'	0 - [OK]
'	1 - [OK] [Cancel]
'	2 - [Abort] [Retry] [Cancel]
'	3 - [Yes] [No] [Cancel]
'	4 - [Yes] [No]
'	5 - [Retry] [Cancel]
'@param defbut
'	0 - 1st as default
'	1 - 2nd as default
'	2 - 3rd as default
'@param mods
'	0 - Application Modal
'	1 - System Modal
Function makeMsgBox(title,mess,icon,buts,defbut,mods)
    butVal = buts + (icon*16) + (defbut*256) + (mods*4096)
    makeMsgBox = MsgBox(mess,butVal,title)
End Function
-->
</script>

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

685 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