Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Yes / No vs OK / Cancel

Posted on 2007-11-19
2
Medium Priority
?
3,022 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 400 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 1600 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

972 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