...

View Full Version : Windows popup confirm script



Dean
02-03-2003, 05:36 PM
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.
:thumbsup: :confused: :confused: :thumbsup:

angiras
02-04-2003, 08:51 AM
if you want your own box you must create a confirmation box component (with asp net)

Dean
02-04-2003, 09:35 AM
hi their

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

angiras
02-04-2003, 10:03 AM
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}:panelConfirm runat=server></{0}:panelConfirm>")> _
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.....

angiras
02-04-2003, 10:13 AM
or here is a personal textArea as componenttextArea (http://www.codeproject.com/aspnet/text_area_control.asp)

Dean
02-04-2003, 11:05 AM
<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>:thumbsup:

angiras
02-04-2003, 11:10 AM
yes it is a normal confirm box .... I thought you wanted to create your own

Dean
02-04-2003, 11:28 AM
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.:thumbsup: :thumbsup:

angiras
02-04-2003, 11:49 AM
then good luck for worming out | :-)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum