Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Location
    Everthorpe, nr Hull, UK
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Windows popup confirm script

    Hi there

    I am trying to get a windows confirm action box to popup and the person clicks yes then it gives them save page box if they click no then it simply dissapears.

    this is the code i have now which gives me the popup but no matter what you click you then cet the save a page box.

    <a href="javascript:doSaveAs()" onClick="confirm('To save this article change the file name from press_release.asp to press_release.htm')">Save this Article</a>

    Can anyone give me a script or correct the mess of a code i have and give me a solution for this problem.

    Also is there any way to change the graphic that appears in the message boxs. so instead of the question mark graphic appearing on a confirm box i can swop this for my logo for the site i working on at the moment..

    all sugestions welcome.
    Cheers

    Dean

    In the beginning god said "let there be light." and from out of the darkness a pen pusher was heard to say "not to much. that's expensive that is!"

  • #2
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    if

    if you want your own box you must create a confirmation box component (with asp net)

  • #3
    Regular Coder
    Join Date
    Sep 2002
    Location
    Everthorpe, nr Hull, UK
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts

    angiras

    hi their

    by any chance have you got anything simaliar that i can simply swap the function on to do what i want.
    Cheers

    Dean

    In the beginning god said "let there be light." and from out of the darkness a pen pusher was heard to say "not to much. that's expensive that is!"

  • #4
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    not really

    I have not directly a confirmation box

    but you could adapt to your needs any component as a panel (or server div) that you can hide and show

    it must starts with (for exemple)

    <DefaultProperty("Text"), ToolboxData("<{0}anelConfirm runat=server></{0}anelConfirm>")> _
    Public Class panelDate
    Inherits Control
    Implements INamingContainer

    then have a few overrides methods as



    Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
    MyBase.OnPreRender(e)

    If EnabledClientSideSupport Then
    Dim script0 As String = "<script src='" + CheminJS(FichierJS) + "'></script>"
    Dim script1 As String = "<script src='" + CheminJS(Fichier) + "'></script>"

    If Not Page.IsClientScriptBlockRegistered(FichierJS) Then
    Page.RegisterClientScriptBlock(FichierJS, script0)
    End If

    If Not Page.IsClientScriptBlockRegistered(Fichier) Then
    Page.RegisterClientScriptBlock(Fichier, script0)
    End If

    End If

    End Sub 'OnPreRender

    Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)

    output.Write("<div id=""PanelConfirm""><script type=""text/javascript"">createConfirm(Tree);</script></div>")

    End Sub



    you can can then write the javascript you need for clien side

    it just a direction.....

  • #5
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    text area

    or here is a personal textArea as componenttextArea

  • #6
    Regular Coder
    Join Date
    Sep 2002
    Location
    Everthorpe, nr Hull, UK
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts

    try this its a lot less code

    <SCRIPT>
    function whereTo()
    {
    var C=confirm('To save this article change the file name from press_release.asp to press_release.htm/rIf you do not wish to save this article please press close.')
    if (C)
    location="javascript:doSaveAs()"
    else
    location="#"
    }
    </SCRIPT>
    Cheers

    Dean

    In the beginning god said "let there be light." and from out of the darkness a pen pusher was heard to say "not to much. that's expensive that is!"

  • #7
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    normal

    yes it is a normal confirm box .... I thought you wanted to create your own

  • #8
    Regular Coder
    Join Date
    Sep 2002
    Location
    Everthorpe, nr Hull, UK
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hi there

    I would of liked a specail one with a our logo but for the time being this does the job.
    i am having a look at the code you have given me and so when i have more time a shall have a good go it. bit busy at the moment what with the ammount of poeple affected by the slammer worm and helping to sort out security upgrades and patches on a few customers systems.

    cheers for the code though i have no oubt it will come in useful when i have the time to sort it all out.
    Cheers

    Dean

    In the beginning god said "let there be light." and from out of the darkness a pen pusher was heard to say "not to much. that's expensive that is!"

  • #9
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    :-)

    then good luck for worming out | :-)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •