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 11 of 11
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question custom alert box

    hi
    is there anyway to make a custom alert box? or anyway to have a click able link on a normal alert box like this click here without a button?thanks...

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    That's not possible with javascript, alternatively, you could do something like this: http://www.javascriptkit.com/script/...tomerror.shtml..

    Keep in mind that popup blockers could block that.. (mine did)

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,315
    Thanks
    29
    Thanked 279 Times in 273 Posts
    You can make your own alert box using HTML, CSS, and JavaScript, but you can’t customize the alert box invoked by alert().

    Edit: Gah. whizard beat me.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #4
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Quote Originally Posted by Arbitrator
    Edit: Gah. whizard beat me.


    Just a question since I've been wondering this forever...

    How exactly do you get the little box around your edit text?

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #5
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,315
    Thanks
    29
    Thanked 279 Times in 273 Posts
    Easy enough: [edit][\/edit]. You’d remove the red character, of course. See the vB code page for more.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #6
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Ahh. Thanks!

    My world has been improved forever, as I gain another VBulletin ability...



    (nothing says nerd like excitement over new Vbulletin abilities....)



    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #7
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oooh, and I just learned from your link you could have said this

    [edit][/edit]

    using noparse. That will come in handy trying to explain to people how to post their code without explaining to hit the # button.

  • #8
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,315
    Thanks
    29
    Thanked 279 Times in 273 Posts
    Quote Originally Posted by david_kw View Post
    Oooh, and I just learned from your link you could have said this

    [edit][/edit]

    using noparse. That will come in handy trying to explain to people how to post their code without explaining to hit the # button.
    Didn’t know that.

    Unfortunately, it seems partially broken for decimal character references (&#160;) which still get parsed unless the [noparse][/noparse] tags only contain part, but not all, of the reference. Non‐breaking spaces also still get stripped and replaced with normal spaces; that’s rather annoying when I want to prevent line breaks in something like font: oblique bolder small-caps 100px/120px "Lucida Sans Unicode", "Lucida Grande", Tahoma, Geneva, sans-serif.

    At least it prevents things like ;) in the previous sentence from being parsed as a graphic. Been wondering how I could get “:p” without the poor image in its place.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by Arbitrator View Post
    Been wondering how I could get “:p” without the poor image in its place.
    You simply disable smilies in text. Its under miscellaneous options.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #10
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,315
    Thanks
    29
    Thanked 279 Times in 273 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    You simply disable smilies in text. Its under miscellaneous options.
    I’m aware of that, but the forum removes that option whenever you’re not using either the Enhanced Interface or Standard Editor for posting. I use the Basic Editor; for some reason it’s assumed that people that use the Basic Editor are partial toward graphical smilies and will never post code that could be parsed as such. If you want to see it for yourself, go to the Control Panel, Edit Options, and alter the Message Editor Interface under Miscellaneous Options at the bottom.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #11
    New Coder
    Join Date
    Jan 2007
    Location
    Chennai, Tamil Nadu, India
    Posts
    71
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Custom Alert Box answered here

    You can create a custom alert box using div, layer and tables.
    first you create a HTML view similar to an alert box by using any of dov,layers and tables. make the visibility property to hidden when loading.
    using javascript make it visible at which ever position you want... and then one more thing... when a default alert box appears we will be able to do any other event on that page... i hope you get my idea... like that you can do when you show your custom alert box by disabling the mouse and keyboard events like the following...

    i have tested this code in Internet explorer


    <script>

    document.onclick=disableEvents
    document.oncontextmenu=disableEvents

    var ef=0

    function showalert()
    {

    ef=1
    var ids
    ids=document.getElementById('alert')
    ids.style.left=300;
    ids.style.top=150;
    ids.style.visibility="visible"
    }

    function disableEvents()
    {
    if(ef)
    return false;
    }
    </script>


    <body>


    <div align=center id="alert" style="position:absolute;left:0;top:0;border: 2px solid gray; width:100; height:100;color:red; background-color:black;visibility:hidden;">

    <br>Alert Message <br><br><br>

    <input type=button name=ok value=0k onclick="ef=0;document.getElementById('alert').style.visibility='hidden';" >

    </div>

    <br><br><br>
    consider there is some error you want show when this link is clicked
    <a href="javascript: showalert();">click here</a>

    </body>

    note: you may wonder how the ok button is working after disabling the onclick event for the whold document... it is because i think the first priority goes to the ok buttons onclick event only after that documents onclick event is checked...

    request: if any one else knows a better solution for the above note please put that to my email jayapalchandran@gmail.com
    http://vikku.info/
    - யானைக்கும் அடிசறுக்கும்


  •  

    Posting Permissions

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