473,324 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Alert with "yes" and "now" as button text

8
Thank you very much , it worked! :)

can you tell me If it is posible to change the 'ok' and 'cancel' to 'yes' and 'no' ???
Aug 8 '12 #1
11 3053
ariful alam
185 100+
@kamiii, what are you really want? can you Xplain please.
Aug 8 '12 #2
kamiii
8
@ariful : thank you for your attention

I want to change the ok buttun to yes or sth else
I want to know is it possible or not?
Aug 8 '12 #3
ariful alam
185 100+
@kamiii, would you please text an example here what you are actually need to do.
Aug 8 '12 #4
kamiii
8
look , I wanted to have a diolog box in order to check that if you are sure to delete an item or not.
and by this code I could do that :

Expand|Select|Wrap|Line Numbers
  1. <asp:ImageButton ID="btnDelete" runat="server" OnClick="btnDelete_Click" ImageUrl="~/Images/icon/deletebuttonoff.png"
  2. CausesValidation="False" OnClientClick="return confirm('are u sure ?')" />

it gives me a diolog box which I should click 'ok' or 'cancel'

now I want to change this 'ok' to 'yes' , and 'cancel' to 'no'
Aug 8 '12 #5
Frinavale
9,735 Expert Mod 8TB
Please post new questions in their own threads. I split this question off of the thread Server Tag Not Well Formed and moved it into the JavaScript forum where it is more likely that the experts know how to achieve what you are looking for.

-Frinny
Aug 8 '12 #6
ariful alam
185 100+
@kamiii, i don't think so. It may be not possible to change the Ok and Cancel button of Confirm Dialog to Yes and No button. You can create your own custom message box using buttons Yes and No in a div tag that may return a value true (for Yes) or false (for No).
Aug 8 '12 #7
kamiii
8
@Frinavale : I didn't get it where should I search for yhis question exactly?!
Aug 8 '12 #8
kamiii
8
@ariful alam: but how?! I haven't any idea at all! :(
would you please tell me what should I do more specifically ?
Aug 8 '12 #9
Frinavale
9,735 Expert Mod 8TB
What @ariful alam is suggesting is suggesting is getting rid of using the JavaScript alert/comfirm completely.

Instead you would have a <div> that would display your message and have 2 buttons "yes" and "no".

So, really your ImageButton would not submit anything to the server at all. When the user clicks the ImageButton, it would display the <div> that contains the message and the "yes" and "no" button.

The Yes button would be the thing that submit to the server...the No button would simply hide the <div>.

Something like this:
Expand|Select|Wrap|Line Numbers
  1. <div id="confirmSubmit" style="display:none; position:absolute; z-index:1; height:200px; width:200px;">
  2.   <div id="messageSection">
  3.     <p>Are you sure?</p>
  4.   </div>
  5.   <div id="buttonSection">
  6.     <asp:Button ID="userConfirmed" OnClick="btnDelete_Click" runat="server" Text="Yes" onclick="document.getElementByID('confirmSubmit').style.display='none'" />
  7.     <input type="button" onclick="document.getElementByID('confirmSubmit').style.display='none'">No</input>
  8.   </div>
  9. </div>
  10.  
Your ImageButton would execute some JavaScript to display the above <div>:
Expand|Select|Wrap|Line Numbers
  1. <asp:ImageButton ID="btnDelete" runat="server"  ImageUrl="~/Images/icon/deletebuttonoff.png"
  2. CausesValidation="False" OnClientClick="document.getElementByID('confirmSubmit').style.display='block'; return false;" />
Make sure that the function signature for the btnDelete_Click method works for the Yes button.

If you don't want to use html <div> and want to stick to ASP.NET controls, you can use Panels like this:

Expand|Select|Wrap|Line Numbers
  1. <asp:Panel ID="confirmSubmit" runat="server" style="display:none; position:absolute; z-index:1; height:200px; width:200px;">
  2.   <asp:Panel ID="messageSection" runat="server">
  3.     <p>Are you sure?</p>
  4.   </asp:Panel>
  5.   <asp:Panel ID="buttonSection" runat="server">
  6.     <asp:Button ID="userConfirmed" OnClick="btnDelete_Click" runat="server" Text="Yes" onclick="document.getElementByID('confirmSubmit').style.display='none'" />
  7.     <asp:Button ID="userCanceled" runat="server" onClientClick="document.getElementByID('confirmSubmit').style.display='none'; return false;" Text="No" />
  8.   </asp:Panel>
  9. </asp:Panel>
  10.  

You can get quite fancy with this. You could display a <div> over top of the content of the page while your message box is displaying to prevent people from interacting with the page. You can style the div to match the look and feel of your website...You can use asp.net Labels and localize your message to fit the language of the user...you could add images or whatever you want to your message...You can do quite a bit with it!



-Frinny
Aug 8 '12 #10
Frinavale
9,735 Expert Mod 8TB
As to where to post questions...

If you have a question that is JavaScript related, ask it in the JavaScript forum where the experts have knowledge about the topic.

If you have an ASP.NET related question, ask it in the ASP.NET forum, where the experts have the knowledge about the topic.

Because ASP.NET is web related, your questions may span across both places...in which case, try to figure out which forum the experts might have more knowledge about the problem and post there :)

And try to limit yourself to 1 question per thread :)

-Frinny
Aug 8 '12 #11
kamiii
8
@Frinavale:

thank you very much Frinny :)
you spent so much time on my questions! thanks alotttt .....

and , ok , sure, I will do what you said about my later questions :)
Aug 11 '12 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Vance Kessler | last post by:
Yes, yes, I know why are we using Crystal 7 under Windows 2003. Well we have to for now. We had a website that was working just fine under Windows 2000 then we re-staged the boxes upgraded to...
1
by: Mark Richards | last post by:
The solutions for the following problems seems to be simple but I did not found a (convenient) solution: Assume we have a number of elements of the same type under a common parent e.g. <person...
13
by: Don Vaillancourt | last post by:
What's going on with Javascript. At the beginning there was the "undefined" value which represented an object which really didn't exist then came the null keyword. But yesterday I stumbled...
28
by: john_sips_tea | last post by:
Just tried Ruby over the past two days. I won't bore you with the reasons I didn't like it, however one thing really struck me about it that I think we (the Python community) can learn from. ...
42
by: usenet | last post by:
I'm still confused about this and I can't find anywhere that explains it properly. I have the MS book "Access 2003" in front of me and I'm reading Part 5 about VB and so on. It's telling me...
9
by: Tristán White | last post by:
Hi I am very new to PHP - actually, this is my second day at it, as I've only recently started a new job last week. We're a charity. I have a "No input file selected" problem. A Google search...
4
by: Jon | last post by:
Hi, I used XslCompiledTransform with the following Xsl file. The <xsl:text disable-output-escaping="yes"does not work when using XslCompiledTransform to do the trnasform (namely the output...
12
by: Pao | last post by:
Hi all For all NEW sites (virtual directories) that I create, I receive always the same error: (I translate so may be a little different) Impossible to visualize the XML page Impossible to...
25
by: tekctrl | last post by:
Anyone: I have a simple MSAccess DB which was created from an old ASCII flatfile. It works fine except for something that just started happening. I'll enter info in a record, save the record,...
2
by: Triciclo | last post by:
We have an Access 2002 Front End Database that will be used by 8 users to enter data. Each user has own copy on their own file in the shared drive. We have tried the Front End in 7 computers and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.