In php code, I am including the alert box to show the errors and this is working. Now I want to make stylish my alert box E.g: colors, font style, bgcolor etc.
Asked
Active
Viewed 46 times
-3
-
21- http://getbootstrap.com/javascript/#modals 2- http://jqueryui.com/dialog/ – smarber Mar 02 '17 at 09:35
-
13. [sweet alert.](http://t4t5.github.io/sweetalert/) – Jai Mar 02 '17 at 09:36
-
40. Go read [ask], please. – CBroe Mar 02 '17 at 09:37
2 Answers
0
window.alert()
is not customizable. You will have to use an overlay or a pop up. Don't use a pop up, though.

Fabian Klötzl
- 407
- 3
- 10
0
The alert box is a system object, and not subject to CSS. To do this style of thing you would need to create an HTML element and mimic the alert()
functionality. The jQuery UI Modal box does a lot of the work for you, working basically as I have described: Link.
Reference by link
Try this
<?php
$my = "hello";
echo "<script>alert('".$my."'); window.location.href='index.php';</script>";
?>

Community
- 1
- 1

Sumit patel
- 3,807
- 9
- 34
- 61
-
-
refer this link http://stackoverflow.com/questions/7853130/how-to-change-the-style-of-alert-box/7853150#7853150 – Sumit patel Mar 02 '17 at 09:46