Link to home
Start Free TrialLog in
Avatar of anoriamalik
anoriamalik

asked on

bold. italic & underline text in alert box

i want the code to make bold, italic & underlined text in alert box. please send me the code in email.
ASKER CERTIFIED SOLUTION
Avatar of ldbkutty
ldbkutty
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zyloch
By the way, anoriamalik, please don't ask us to email the solution, this just defies the purpose of EE, which is to let future persons use these comments we make to answer their own questions.

Furthermore, how are we to find your email as it is not shown and is not in your profile?
Avatar of minichicken
minichicken

Maybe use something like this

window.open ("alert.htm", "myalert", "width= 100, height= 100");
Here try this

<script language="JavaScript">
// Function to add the code for bold italic and underline, to the message
function AddMessageCode(code,promptText, InsertText) {

     if (code != "") {
        insertCode = prompt(promptText + "\n<" + code + ">xxx</" + code + ">", InsertText);
     if ((insertCode != null) && (insertCode != "")){
        document.story.body.value += "<" + code + ">" + insertCode + "</"+ code + "> ";
        } }            
     document.story.body.focus();
}
</script>

The above is the script and below is the triggger

<a href="JavaScript:AddMessageCode('strong','Enter text you want formatted in Bold', '')"><img src="bold.gif" border="0" alt="Bold"></a>
<a href="JavaScript:AddMessageCode('em','Enter text you want formatted in Italic', '')"><img src="italic.gif" border="0" alt="Italic"></a>
<a href="JavaScript:AddMessageCode('u','Enter text you want Underlined', '')"><img src="underline.gif" border="0" alt="Underline"></a>      

I think this is what you are after
ant      
How did you go anoriamalik
ant