Alert

Good morning, I’m using a function within an iframe :

dhtmlx.alert({
    title:"Alert",
    type:"alert-error",
    text:"You can't do this"	
});

How do I alert appear out of iframes and centered on the screen ?

Ex.

Tks.

Hello
You need to address to parental window:

window.parent.dhtmlx.alert({ title:"Alert", type:"alert-error", text:"You can't do this" });

Demo
index.html file:

[code]


DHTMLX test




html,body { width: 100%; height: 100%; margin: 0; }


[/code] newpage.html file: [code] DHTMLX test html,body { width: 100%; height: 100%; margin: 0; } [/code]

thank you.

:slight_smile:

You can remove the modal ?

You can manipulate the opacity property yourself via this style:

div.dhx_modal_cover { opacity: 0.2; }
This setting must be on “index” page. You can apply opacity: 0 to clear modal mask at all

Where do I put the function ?
index.php

<?php include "conexao.php";?>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<link rel="stylesheet" type="text/css" href="suite/codebase/dhtmlx.css"/>
	<script src="suite/codebase/dhtmlx.js"></script>
	<style>
		div.controls {
			margin: 0px 10px;
			font-size: 14px;
			font-family: Tahoma;
			color: #404040;
			height: 80px;
		}
		div#winVP {
			position: relative;
			height: 350px;
			border: #a4bed4 1px solid;
			border-radius: 2px;
			margin: 10px;
		}
	</style>
	<script>
	var dhxWins, w1;
	function doOnLoad(){
		dhxWins = new dhtmlXWindows();
		dhxWins.attachViewportTo("winVP");
	
		w1 = dhxWins.createWindow("w1", 20, 30, 450, 270);
		w1.setText("Acesso");
		w1.button("minmax1").hide();
		w1.button("close").hide();
		w1.attachURL("login.php");
		dhxWins.window("w1").setModal(true);
		dhxWins.window("w1").center();
		w1.denyResize();
		w1.denyPark();
		w1.hideHeader();
	}
	
	function Conectar(cpf, senha){
		window.open('conecta.php?TxCPF='+cpf+'&TxSenha='+senha, "_self");
	}
	</script>
</head>
<body style="margin:0px;background: url(imagens/franquias/2.png) no-repeat top left;" onLoad="javascript:doOnLoad();">
<div id="winVP" style="position: relative; border: #FFF 1px solid; margin: 0px;"></div>
</body>
</html>
<script language="javascript">if(myHeight == 0){myHeight = 500;}document.getElementById('winVP').style.height = (myHeight-2);</script>

Put it into the tag :slight_smile: