Solved

Yes / No vs OK / Cancel

Posted on 2007-11-19
2
2,993 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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