SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Stockholm, Sweden
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    diff msg boxes in javascript

    hi,
    i need to know how to make an inputbox( a msg box with a textfield) and a msg box with yes and no buttons (regular msg or alert boxes only have an ok button) in javascript/jscript.
    i could always learn the whole language but i dont have the time see, im already learning like twenty other languages at the same time and another one would make me forget the old ones

    thanks

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Stockholm, Sweden
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what ive heard the yes, no box is impossible with javascript so i have to use VBScript to accomplish this, does anyone know how to do that?
    And for you who want to know, the inputbox thingy is possible and the syntax looks something like this:

    inputValue = prompt( "text", "" );

  3. #3
    SitePoint Zealot
    Join Date
    Dec 1999
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kint:

    Here's the code if you want to create a Yes/No alert with VBScript:

    <script language="VBScript">
    msgbox "Text goes here", vbExclamation + vbYesNo, "Title goes here"
    </script>

    As you can see, this is normal VB code. Remember always to declare the language you are using in the script tag.

    Hope that helps

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Stockholm, Sweden
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, but how do i know which button the user pushed? What does the function return?

  5. #5
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heres a if clause working from a prompt box

    Code:
    if (confirm("Are you sure you want to delete this page from the databse?")) {
    document.delform.submit()
    }else{
    location.href="delpage.asp"
    }
    hope that helps


Bookmarks

Posting Permissions

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