Solved

Yes / No vs OK / Cancel

Posted on 2007-11-19
2
2,954 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: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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 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