Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to create a box like the alert or confirm box

    hi, does any body knows how to create a box in java, or javascript to show into a html page to put some text whit some decoration ie(color, bold, etc), with the possibility to change the title or put an image inside. Its like the about boxes you found in all microsoft aplications on help menu.

    Thanks

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    search confirm alert in the post a script forum. See if you get anything there.

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can't create your own context popups like that. You can pop-up an HTML page - but that's it.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #4
    New to the CF scene
    Join Date
    Mar 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can try using modal/modeless dialogs- make the background of the page in a modal dialog grayish to make it more alert box-ish

  • #5
    New Coder
    Join Date
    Jul 2003
    Location
    Houston, Texas
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is some code for a custom prompt. See if you can modify it for alerts.


    <!-- TWO STEPS TO INSTALL CUSTOMIZABLE JAVASCRIPT PROMPT:



    1. Copy the coding into the HEAD of your HTML document

    2. Add the last code into the BODY of your HTML document -->



    <!-- STEP ONE: Paste this code into the HEAD of your HTML document -->



    <HEAD>




    <style type="text/css">

    <!--/*************************** below code can be in a css file *****************************/-->

    input.prompt {border:1 solid transparent; background-color:#99ccff;width:70;font-family:arial;font-size:12; color:black;}

    td.titlebar { background-color:#FF9F40; color:#0000D2; font-weight:bold;font-family:arial; font-size:12;}

    table.promptbox {border:1 solid #ccccff; background-color:#FFFFE6; color:black;padding-left:2;padding-right:2;padding-bottom:2;font-family:arial; font-size:12;}

    input.promptbox {border:1 solid #0000FF; background-color:white;width:100%;font-family:arial;font-size:12; color:black; }

    <!--/*************************** end css file *****************************/-->



    </style>



    <script language='javascript'>



    /*************************** below code can be in a js file *****************************/

    var response = null



    function prompt2(promptpicture, prompttitle, message, sendto) {

    promptbox = document.createElement('div');

    promptbox.setAttribute ('id' , 'prompt')

    document.getElementsByTagName('body')[0].appendChild(promptbox)

    promptbox = eval("document.getElementById('prompt').style")

    promptbox.position = 'absolute'

    promptbox.top = 100

    promptbox.left = 200

    promptbox.width = 300

    promptbox.border = 'outset 1 #bbbbbb'

    document.getElementById('prompt').innerHTML = "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr valign='middle'><td width='22' height='22' style='text-indent:2;' class='titlebar'><img src='" + promptpicture + "' height='18' width='18'></td><td class='titlebar'>" + prompttitle + "</td></tr></table>"

    document.getElementById('prompt').innerHTML = document.getElementById('prompt').innerHTML + "<table cellspacing='0' cellpadding='0' border='0' width='100%' class='promptbox'><tr><td>" + message + "</td></tr><tr><td><input type='text' id='promptbox' onblur='this.focus()' class='promptbox'></td></tr><tr><td align='right'><br><input type='button' class='prompt' value='OK' onMouseOver='this.style.border=\"1 outset #dddddd\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(document.getElementById(\"promptbox\").value); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'> <input type='button' class='prompt' value='Cancel' onMouseOver='this.style.border=\"1 outset transparent\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(\"\"); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'></td></tr></table>"

    document.getElementById("promptbox").focus()

    }

    function myfunction(value) {

    if(value.length<=0)



    return false;

    else

    document.getElementById('output').innerHTML="<b>"+value+"</b>";

    }



    /*************************** js file code *****************************/

    </script>

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



    <!-- STEP TWO: Copy this code into the BODY of your HTML document -->



    <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>
    Beyond a critical point within a finite space, freedom diminishes as numbers increase. ...The human question is not how many can possibly survive within the system, but what kind of existence is possible for those who do survive."


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •