| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| 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. |
![]() |
|
|
Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
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.) |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
Thanks
Nice one Zvona - confirm is the fellow I was after.
Thanks. |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|