This is a discussion on How to bold a text in alert or confirm alert box? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; How to bold a text in the confirm alert box or confirm box in javascript? is it possible? can anyone ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| How to bold a text in the confirm alert box or confirm box in javascript? is it possible? can anyone help me in this..
__________________ $enthil Last edited by $enthil : 09-05-2007 at 05:30 AM. |
| Sponsored Links |
| |||
| Please try this script ![]() |
| |||
| Hi, We can bold the text in alert box or confirm box.. Here i am giving one samples for bold the text... U can try this, hope it will satisfy u... Code follows, Code: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>untitled</title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<script type="text/javascript">
//<![CDATA[
function doConfirm(v)
{
var b = document.getElementById('btn');
b.value = 'Display dialog [last return value: ' + v + '/' + (v ? 'OK' : 'Cancel') + ']';
}
function setDisp(id, disp)
{
document.getElementById(id).style.display = disp;
}
//]]>
</script>
<style type="text/css">
/*<![CDATA[*/
#confirm {
position: absolute;
top: 40px;
left: 70px;
border: outset #000 10px;
padding: 1em 3em;
display: none;
background: #a5c4cc;
}
#ok {
background: #a5cca8;
}
#cancel {
background: #d6a4a4;
}
#ok, #cancel {
padding: 2px;
margin:2px;
}
/*]]>*/
</style>
</head>
<body>
<div id="confirm">
<div><strong>Are</strong> <em>you</em> <span style="text-decoration: underline;">sure</span>?</div>
<input type="button" id="ok" value="OK" onclick="doConfirm(true);setDisp('confirm', 'none');" />
<input type="button" id="cancel" value="Cancel" onclick="doConfirm(false);setDisp('confirm', 'none');" />
</div>
<div><input type="button" id="btn" value="Display dialog" onclick="setDisp('confirm', 'block');" /></div>
</body>
</html>
__________________ Krishnakumar.S Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily |
| |||
| hi vadivel & krishna, The code you have given is working but that is not a proper alert box or confirm box. Because they are displayed in the page itself. I mean that the alert should be popuped but here even the popup blocker is on, the alert or confirm box is displaying. Can anyone tell me the proper solution for my problem.
__________________ $enthil |
| |||
| hi senthil it is not possible in javascript but it can be done throug div which is said by vadivelan vaidyanathan and krishnakumar its not affect the popup blocker. |
| |||
| <html> <head> <SCRIPT LANGUAGE="JavaScript"> <!-- function callPrompt(){ prompt2('btn1p.gif', 'My Prompt','Please enter your name ,if you want to chat with our <B>customer support executive</B>', 'myfunction'); } //--> </SCRIPT> </head> <body> <input type="button" value='show prompt' onClick="callPrompt()"> </CENTER> <div id="output" style="position:absolute;background-color:#FFFFCC;width:200;height:50;left:300;top:150 ;border:1 solid #FF8000;color:#0000F2"></div> </body> </html> |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Count down from 15 seconds and then display an alert message | itbarota | HTML, CSS and Javascript Coding Techniques | 2 | 02-29-2008 01:15 AM |
| Alert after five seconds | itbarota | HTML, CSS and Javascript Coding Techniques | 1 | 02-28-2008 04:23 AM |
| HOw to disable Confirm password popup window in Firefox browser | GDevakii | HTML, CSS and Javascript Coding Techniques | 0 | 09-24-2007 04:33 AM |
| When running my MIDlet, a security alert is displayed and cannot be dismissed. ? | mobilegeek | Mobile Software Development | 1 | 07-25-2007 11:19 PM |
| Outlook - Mail subject empty alert | priyan | Microsoft | 1 | 07-11-2007 07:57 AM |