JavaScript - change alertbox title name - Asked By sailaja ravula on 29-Jun-12 05:54 AM

Hi, 
I want to change the title of the alert Message box in Javascript. By default it shows only "Microsoft Internet Explorer ". I want my own title message. 

kindly suggest me the answer. 
Sathish S replied to sailaja ravula on 29-Jun-12 06:04 AM
Not possible when you are using Javascript alerts.

You may use VBScript or Jquery
http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/ 
Chintan Vaghela replied to sailaja ravula on 29-Jun-12 06:05 AM

Hi Frndz,

 

Functionality:  Change Title in Javascript Alert Meeage

 

 

You can not  change Title for Alert message in javascript

 

Its a  security  features.

 

 

 

Hope this helpful!

Thanks

 

 

 

Jitendra Faye replied to sailaja ravula on 29-Jun-12 06:25 AM
you can not change title of alert box, for this you can use jquery popup control.
like this this-

If you want to show modal popup then use jquery popup.


after adding jqueryui plugin you can use it.


like this-


<script>


function funShow() {

$('#dialog).dialog({ resizable: false, height: 140, modal: true });

}
</script>


<div id="dialog" title="Basic dialog">hi
</div>



<asp:Button runat="server" Text="Button" onClientClick="return funShow()" />


FOR EXAMPLE FOLLOW THIS

-http://jqueryui.com/demos/dialog/


 
Vikram Singh Saini replied to sailaja ravula on 29-Jun-12 06:42 AM
You can use third party Telerik's control RadAlert for same.

Check link: http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx
Lalit M replied to sailaja ravula on 29-Jun-12 07:05 AM
you can't change the title name of alert box its a security/anti-phishing feature.

you can created a custom Alert box by overloading the alert( ) method.

check here for help
-----------------
http://slayeroffice.com/code/custom_alert/
dipa ahuja replied to sailaja ravula on 29-Jun-12 08:53 AM

Using JavaScript simple alert box :

Page.RegisterClientScriptBlock("""<script>alert('Book Added');</script>");

Response.Write("<script>alert('Book Added')</script>");

Or you can display your own window by

using the modalpopupExtender:

CSS Effect

----------

<style type="text/css">

  .modalBackground

  {

  background-color#CCCCFF;

  filteralpha(opacity=40);

  opacity0.5;

  }

  .ModalWindow

  {

  bordersolid1px#c0c0c0;

  background-color#99ccff;

  padding0px10px10px10px;

  positionabsolute;

  top-1000px;

  }

</style>

ModapPopUp Code

------------------------

<cc1:ModalPopupExtender TargetControlID="Button2" BackgroundCssClass="modalBackground"

CancelControlID="btnMsg" PopupControlID="Panel1" PopupDragHandleControlID="btnMsg"

ID="ModalPopupExtender2" runat="server">

</cc1:ModalPopupExtender>

<asp:Panel ID="Panel1" runat="server" CssClass="ModalWindow">

<%--Button popup--%>

<center>

<table runat="server">

<tr>

  <td bgcolor="#cccccc" style="border: 1px; border-color: Black;" height="20px" align="left"

  valign="top">

  <div style="border-bottom-width: 1px; border: 1px solid">

  Deletion</div>

  </td>

</tr>

<tr>

  <td align="center" bgcolor="#99ccff">

  <br />

  The Record has been deleted!

  </td>

</tr>

</table>

<asp:Button ID="btnMsg" runat="server" Text="OK" /><br />

</center>

</asp:Panel>

<asp:Button ID="Button2" runat="server" Text="OK" /><br />



avula replied to dipa ahuja on 03-Jul-12 01:31 AM
hi
You can't change Title of the Alert box using javascript..

use fallowing plug-in..
you can customize as much as you speak.
its very required any application that entire look and feel of alerts,confirms boxes should be same
jquery.alerts.js
jquery.alerts.css
http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/

regards.