Nitinol
asked on
Bold alert box text..... how?
Is there a way, and I have seen it done before, to make the text of an alert box, bold or italic?
I have seen it done before and used to know how to do it, but could someone pleae refresh my memory?
I have seen it done before and used to know how to do it, but could someone pleae refresh my memory?
try a modal dialog
<script>
var AlertBox = window.showModelessDialog( "Alert.htm ","",'dial ogWidth:20 ; dialogHeight:10; status:0; help:0');
</script>
in Alert.htm have
<body bgColor="grey">
<center>
<b>Alert</b><p>
You are warned!
</center>
<script>
var AlertBox = window.showModelessDialog(
</script>
in Alert.htm have
<body bgColor="grey">
<center>
<b>Alert</b><p>
You are warned!
</center>
sorry I meant
<script>
var AlertBox = window.showModalDialog("Al ert.htm"," ",'dialogW idth:20; dialogHeight:10; status:0; help:0');
</script>
in Alert.htm have
<body bgColor="grey">
<center>
<b>Alert</b><p>
You are warned!
</center>
</body>
<script>
var AlertBox = window.showModalDialog("Al
</script>
in Alert.htm have
<body bgColor="grey">
<center>
<b>Alert</b><p>
You are warned!
</center>
</body>
hi there,
try out this code i wrote:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<style>
#myAlert{
position:absolute;
top:250px;
left:250px;
background-color:silver;
display:none;
width:250px;
height:75px;
}
#AlertTitle{
color:white;
font-size:12px;
font-weight:bold;
width:100%;
}
#table1{
border: 2px outset;
width:100%;
}
#AlertContent{
color:black;
font-size:12px;
width:100%;
}
#OKButton{
padding:3px;
font-size:10px;
background-color:silver;
}
</style>
<script>
function centerObject( obj ){
// var left = window.screen.availWidth/2 - obj.style.width/2;
// var top = window.screen.availHeight/ 2 - obj.style.height/2;
var top = window.screen.width/4 - obj.style.width;
var left = window.screen.height/4 - obj.style.height;
obj.style.left = left;
obj.style.top = top;
}
function swapAlert(){
var target = document.getElementById('M yAlert');
var button = document.getElementById('s witchButto n');
centerObject(target);
if ( target.style.display== 'block'){
target.style.display= 'none';
button.value='Show Alert';
return;
}
else{
target.style.display= 'block';
button.value='Hide Alert';
return;
}
}
</script>
<span id='MyAlert'>
<table id='table1' cellpadding="0" cellpadding="0">
<tr bgcolor="#00006A">
<td id='AlertTitle' width="100%"> Alert Title</td>
</tr>
<tr>
<td id='AlertContent' width="100%"><b>Alert Context goes here.</b></td>
</tr>
<tr>
<td id='AlertContent' width="100%"><br><center>< input id='OKButton' onclick='swapAlert()' type='button' value=' OK  ; '>< /center></ td>
</tr>
</table>
</span>
<br><br>
<input type="Button" id='switchButton' onclick='swapAlert()' value='Show Alert'>
</body>
</html>
Nushi.
try out this code i wrote:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<style>
#myAlert{
position:absolute;
top:250px;
left:250px;
background-color:silver;
display:none;
width:250px;
height:75px;
}
#AlertTitle{
color:white;
font-size:12px;
font-weight:bold;
width:100%;
}
#table1{
border: 2px outset;
width:100%;
}
#AlertContent{
color:black;
font-size:12px;
width:100%;
}
#OKButton{
padding:3px;
font-size:10px;
background-color:silver;
}
</style>
<script>
function centerObject( obj ){
// var left = window.screen.availWidth/2
// var top = window.screen.availHeight/
var top = window.screen.width/4 - obj.style.width;
var left = window.screen.height/4 - obj.style.height;
obj.style.left = left;
obj.style.top = top;
}
function swapAlert(){
var target = document.getElementById('M
var button = document.getElementById('s
centerObject(target);
if ( target.style.display== 'block'){
target.style.display= 'none';
button.value='Show Alert';
return;
}
else{
target.style.display= 'block';
button.value='Hide Alert';
return;
}
}
</script>
<span id='MyAlert'>
<table id='table1' cellpadding="0" cellpadding="0">
<tr bgcolor="#00006A">
<td id='AlertTitle' width="100%"> Alert Title</td>
</tr>
<tr>
<td id='AlertContent' width="100%"><b>Alert Context goes here.</b></td>
</tr>
<tr>
<td id='AlertContent' width="100%"><br><center><
</tr>
</table>
</span>
<br><br>
<input type="Button" id='switchButton' onclick='swapAlert()' value='Show Alert'>
</body>
</html>
Nushi.
ASKER
All of your comments were interesting, but I remember it being something really simple... Maybe I was working with an old browser that actually supported it or something.... Thank you for your responses, but none are what I am looking for....
GwynforWeb - your web dialog comes up, but it is all white, there is not message on it at all....... it say's web dialog on it, but
there is nothing on the box except for a white background.... Is this what you intended.... The bright green screen though, that was interesting.....
GwynforWeb - your web dialog comes up, but it is all white, there is not message on it at all....... it say's web dialog on it, but
there is nothing on the box except for a white background.... Is this what you intended.... The bright green screen though, that was interesting.....
ASKER
Nushi, to hide and show an alert box would be too much trouble, and not important enough to do for all the code that went into that.....
There is not need for me to go that far with it.... Especially since I would have to hide the rest of the content on my page to make that alert actually look convincing..... thank you for your response though, it's much appreciated
There is not need for me to go that far with it.... Especially since I would have to hide the rest of the content on my page to make that alert actually look convincing..... thank you for your response though, it's much appreciated
>>Especially since I would have to hide the rest of the content on my page to make that alert actually look convincing
you dont need to.
simply set in the style "z-index:100" and it will be the most top.
Nushi.
you dont need to.
simply set in the style "z-index:100" and it will be the most top.
Nushi.
ASKER
ok, thats true....., but still thats too much trouble to go through for an alert box
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
we cannot format alter box. It out of control of javascript.
ASKER
Thx for trying to help out Nushi, much appreciated
Np.
in here to help as much as i can.
Nushi.
in here to help as much as i can.
Nushi.
- Matt