Link:http://output.to/sideway/default.asp?qno=180400010 Script, Scripting Language, VBScript elements, Server-Side VBScript Function InputBox, MsgBox Function
VBScript Misc FunctionsFunctions for manipulating misc operation. However all modern browser does not support VBScript InputBox and MsgBox functions directly. InputBox Functionlast updated 9/19/2017Create and display a standard input dialog box with a text box and a given prompt in the dialog box according to the specified title, default, xpos, ypos, helpfile and context arguments. The dialog box will wait for the user to input text or click a button to continue. SyntaxInputBox(prompt[, title][, default][, xpos][, ypos][, helpfile, context]) ArgumentpromptRequired. String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return–linefeed character combination (Chr(13)&Chr(10)) between each line.titleOptional. String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar.defaultOptional. String expression displayed in the text box as the default response if no other input is provided. If you omit default, the text box is displayed empty.xposOptional. Numeric expression that specifies, in twips, the horizontal distance of the left edge of the dialog box from the left edge of the screen. If xpos is omitted, the dialog box is horizontally centered.yposOptional. Numeric expression that specifies, in twips, the vertical distance of the upper edge of the dialog box from the top of the screen. If ypos is omitted, the dialog box is vertically positioned approximately one-third of the way down the screen.helpfileOptional. String expression that identifies the Help file to use to provide context-sensitive Help for the dialog box. If helpfile is provided, context must also be provided.contextOptional. Numeric expression that identifies the Help context number assigned by the Help author to the appropriate Help topic. If context is provided, helpfile must also be provided.ReturnsReturns a Variant of the String data subtype containing the contents of the text box obtained from input dialog box entered by the user.Remarks
Requirement1ExamplesAlthough all modern browser does not support VBScript InputBox and MsgBox functions directly, VBScript can still be tested using Microsoft Internet Explorer 11 after adding '<meta http-equiv="x-ua-compatible" content="IE=10">' to HEAD tag. Both client side VBScript InputBox and MsgBox functions can be used in server side indirectly through creating a client side Script on the fly to run a ?document.write?. Ref.:https://msdn.microsoft.com/library/dn384057(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/apps/Hh700404.aspx Examples of InputBox function Ref.: ASP VbScript Command:
MsgBox Functionlast updated 9/20/2017Create and display a standard message dialog box with a given prompt in the dialog box according to the specified buttons, title, helpfile and context arguments. The dialog box will wait for the user to click a button to continue. SyntaxMsgBox(prompt[, buttons][, title][, helpfile, context]) ArgumentpromptRequire. String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return–linefeed character combination (Chr(13)&Chr(10)) between each line.buttonsOptional Setting. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. See Settings section for values. If omitted, the default value for buttons is 0.titleRequired. String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar.helpfileRequired. String expression that identifies the Help file to use to provide context-sensitive Help for the dialog box. If helpfile is provided, context must also be provided. Not available on 16-bit platforms.contextRequired. Numeric expression that identifies the Help context number assigned by the Help author to the appropriate Help topic. If context is provided, helpfile must also be provided. Not available on 16-bit platforms.Settingsbuttons argument vbConstantValueConstantvbOKOnly0Display OK button only.vbOKCancel1Display OK and Cancel buttons.vbAbortRetryIgnore2Display Abort, Retry, and Ignore buttons.vbYesNoCancel3Display Yes, No, and Cancel buttons.vbYesNo4Display Yes and No buttons.vbRetryCancel5Display Retry and Cancel buttons.vbCritical16Display Critical Message icon. vbQuestion32Display Warning Query icon.vbExclamation48Display Warning Message icon.vbInformation64Display Information Message icon.vbDefaultButton10First button is default.vbDefaultButton2256Second button is default.vbDefaultButton3512Third button is default.vbDefaultButton4768Fourth button is default.vbApplicationModal0Application modal. The user must respond to the message box before continuing work in the current application.vbSystemModal4096System modal. On Microsoft Win16 systems, all applications are suspended until the user responds to the message box. On Microsoft Win32 systems, this constant provides an application modal message box that always remains on top of any other programs that you have running The first group of values (0–5) describes the number and type of buttons displayed in the dialog box; the second group (16, 32, 48, 64) describes the icon style; the third group (0, 256, 512, 768) determines which button is the default; and the fourth group (0, 4096) determines the modality of the message box. When adding numbers to create a final value for the argument buttons, use only one number from each group.ReturnsReturns a Variant of the Integer data subtype containing the type of button obtained from message dialog box clicked by the user.Return values of MsgBox function vbConstantValueConstantvbOK1OKvbCancel2CancelvbAbort3AbortvbRetry4RetryvbIgnore5IgnorevbYes6YesvbNo7No Remarks
Requirement1ExamplesAlthough all modern browser does not support VBScript InputBox and MsgBox functions directly, VBScript can still be tested using Microsoft Internet Explorer 11 after adding '<meta http-equiv="x-ua-compatible" content="IE=10">' to HEAD tag. Both client side VBScript InputBox and MsgBox functions can be used in server side indirectly through creating a client side Script on the fly to run a ?document.write?. Ref.:https://msdn.microsoft.com/library/dn384057(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/apps/Hh700404.aspx Examples of MsgBox function ASP VbScript Command:
|
Sideway BICK Blog 10/04 |