IT Community - Software Programming, Web Development and Technical Support

How to bold a text in alert or confirm alert box?

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 ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-05-2007, 05:12 AM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Lightbulb How to bold a text in alert or confirm alert box?

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-05-2007, 07:05 AM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Default Re: How to bold a text in alert or confirm alert box?

Please try this script
Attached Files
File Type: txt Javascript.txt (3.2 KB, 13 views)
__________________
V.Vadivelan

There never a wrong time to do the right thing.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-05-2007, 07:52 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Smile Re: How to bold a text in alert or confirm alert box?

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-05-2007, 08:18 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Re: How to bold a text in alert or confirm alert box?

Hi,


Is there any way to modify the alert box button's text in javascript.


thnx...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-06-2007, 12:00 AM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Lightbulb Re: How to bold a text in alert or confirm alert box?

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-06-2007, 01:55 AM
varghese varghese is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 93
varghese is on a distinguished road
Default Re: How to bold a text in alert or confirm alert box?

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-06-2007, 02:55 AM
varghese varghese is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 93
varghese is on a distinguished road
Default Re: How to bold a text in alert or confirm alert box?

hi Deepan
it is not possible in javascript but we can do this in vbscript but it not work in firefox.Better we can do this with div tag.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 10-26-2007, 06:24 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Smile Re: How to bold a text in alert or confirm alert box?

<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>
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 04:23 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0