CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Other Programming > Scripting - Client Side
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Scripting - Client Side Discuss client-side scripting issues. Client-side scripting such as JavaScript, JScript, and VBScript as well as technologies such as HTML and stylesheets.

    Reply
     
    Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
      #1    
    Old June 25th, 2002, 06:18 AM
    Surrendermonkey Surrendermonkey is offline
    Member
     
    Join Date: Sep 1999
    Location: Leeds U.K. (Proud to be Sheffield Born)
    Posts: 202
    Surrendermonkey is an unknown quantity at this point (<10)
    msgbox Javascript

    Hi gurus.
    Simple question - I have alert();, which is fine, I have prompt();, which is fine, but how can I duplicate msgbox("whatever", vbYesNo) in javascript?

    I just want to give my users an opportunity to confirm or cancel a delete.

    Any help always gratefully accepted.
    Cheers,
    S. Monkey (Mr.)
    Reply With Quote
      #2    
    Old June 26th, 2002, 01:20 AM
    anupam kant anupam kant is offline
    Member
     
    Join Date: May 2002
    Location: India
    Posts: 139
    anupam kant is on a distinguished road (10+)
    MsgBox in Javascript

    yes javascript has no MsgBox like functionality. still you can use VBScript MsgBox in JS.

    Refer this cade:

    <SCRIPT LANGUAGE=vbscript>
    function callMsgBox2(strMsg)
    'second parameter is msgBox type
    callMsgBox2 = msgBox(strMsg,1)
    end function
    </SCRIPT>

    <SCRIPT LANGUAGE=javascript>
    <!--
    function callMsgBox1(strMsg)
    {
    var retVal = callMsgBox2(strMsg)
    }
    // call this javascript function instead of alert/confirm

    callMsgBox1('This is message box.!')
    //-->
    </SCRIPT>
    __________________
    Anupam.
    Reply With Quote
      #3    
    Old June 26th, 2002, 03:08 AM
    Zvona Zvona is offline
    Member
     
    Join Date: Jan 2002
    Location: Helsinki, Finland
    Posts: 99
    Zvona is an unknown quantity at this point (<10)
    Personally, I don't recommend using VBScript at all, if you're not certain what kind of environment end-user has.

    Javascript has 3 functions for dialog boxes :
    window.alert() for informational dialogs
    window.prompt() for text-input dialog
    window.confirm() for yes/no dialog

    If you need to do a dialog window with custom content (like yes/no/i'm not sure/just cancel buttons), you should read thread :
    http://www.codeguru.com/forum/showth...hreadid=193184
    __________________
    Zvona - First aid for client-side web design
    Reply With Quote
      #4    
    Old June 26th, 2002, 09:07 AM
    Surrendermonkey Surrendermonkey is offline
    Member
     
    Join Date: Sep 1999
    Location: Leeds U.K. (Proud to be Sheffield Born)
    Posts: 202
    Surrendermonkey is an unknown quantity at this point (<10)
    Thanks

    Nice one Zvona - confirm is the fellow I was after.

    Thanks.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Other Programming > Scripting - Client Side


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

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

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 05:59 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009