Welcome to ITM Web100 Training Program


Lesson 7

VBScript
Microsoft VBScript (Visual Basic Scripting Edition) is a lightweight version of Microsoft Visual Basic for Applications. Works with Microsoft Internet Explorer , VBScript is fast becoming one of the most widely used server-side scripting languages for the Windows environment:

VBScript's popularity on the client side of the Web is--to say the least--limited. However, corporate intranets often support VBScript both in the browser and on the server--usually as an extension of their VB development.

Lets see few examples of VBScript :

Simple client-side validation 
Before the advent of client-side scripting languages, you had to wait until form data was submitted to the server for processing before you could determine if the data was acceptable. In the case of incorrect or inappropriate data, this meant sending another page back to the browser to inform the user of the problem. Now, you can use VBScript to validate data even before it leaves the browser--thereby saving the user's time and the Internet's bandwidth.

Validating input is important to ensure you receive data that you can work with. For example, if you asked the user to enter their age, you would expect them to enter a number. However, if they entered Twenty in the box, you wouldn't be able to add this to your database.

You must first decide when during the data-entry process you are going to validate the input. You can validate during the input, after an individual input, or immediately before the form is submitted.

Here we see as how to validate input as the user moves away from a particular control. This is achieved using the onBlur event, which is fired when the user moves the focus to another control. You can write a script against the onBlur event to determine if the data entered is valid.

This simple example uses the onBlur event to say hello to the user once they have entered their first and last names in the text boxes. The onBlur event is fired automatically by the browser when the user moves away from a text field or other form-based object. By including the SayHello function, you are handling this event, which means that the SayHello function will be executed as the user moves away from the txtLastName text box.

<HTML>
<SCRIPT language="vbscript">
  Function SayHello
    Alert "Hello" & Document.names.txtFirstName.Value & " " & Document.names.txtLastName.Value
  End Function
</SCRIPT>
<BODY>
<CENTER>
<FORM name="names">
Your first name: <INPUT type="text" name="txtFirstName"><BR>
Your last name: <INPUT type="text" name="txtLastName" onBlur="SayHello"><BR>
</FORM>
</CENTER>
</BODY>
</HTML>

Check this out

Lets see another VBScript feature

Here the button responds to the click event

First, there is an <INPUT> tag that creates a button named BtnHello.

	
<INPUT TYPE=BUTTON VALUE="Click me" NAME="BtnHello">
Second, there is a <SCRIPT> tag that contains an event handler for the BtnHello OnClick event. As in Microsoft® Visual Basic®, event handlers are named using the pattern ObjectName_EventName, in this case, BtnHello_OnClick. When the button is clicked, the procedure with that name is run. In response to the button being clicked, the event handler displays a message box by using the VBScript MsgBox run-time function.

<SCRIPT LANGUAGE="VBScript">
	Sub BtnHello_OnClick
		MsgBox "Hello There!", 0, "ITM Web Class "
	End Sub
</SCRIPT>

This is another VBScript demo

Learn to Add

VBScript can mainly be used for developing Intranet Applications.
See How VBScript can be used to Validate Data before sending to the server.

FrontPage98

FrontPage98 is the tool you were waiting for, this will solve all your worries and make you the best.

FrontPage 98 has quite a few added "bells and whistles" over FrontPage 97, far too many, From beginning to end, FrontPage 98 is a giant leap forward over Frontpage 97. Let's take a look under the hood, at a few of the most interesting and useful ones:

FrontPage Explorer

navbar.jpg (8480 bytes)

The new
FrontPage
Toolbar

FrontPage Explorer has a new "toolbar." When you open FrontPage Explorer, you'll see a bar along the left side of the screen, with a number of icons on it. These are all related to the "view" you see in the 2 panes to the right. Some of these are familiar, and some are brand new.

The top one, "Folder," is the same as the "folder" View command on the old menu. Nothing new there. Looks just like the Windows Explorer, with a few minor differences. Works like Windows Explorer too, with a few major differences.

The "Navigation" view provides some handy tools for visually constructing the navigational properties of your website, including the use of   "navigation bars"  and "shared borders." You can create links, move pages, and link pages visually in Navigation View.

The "Hyperlinks" view is another view which is inherited from FrontPage 97. This is the view which shows the hyperlinks to and from each page, and allows you to trace links from one page to another, and so on. It will also show you broken links.

The "Hyperlink Status" view is similar to the Tools|Verify Hyperlinks command in FrontPage 97, but retains the list between calls, and doesn't dictate that the hyperlinks be verified, unless you want to. In other words, it will show you any hyperlinks which are "unknown" in status, including hyperlinks outside of the current web.

The "Themes" view is a rather nice addition. FrontPage 98 Themes aloows you to choose from over 50 pre-built themes, which can be instantly applied to all pages within a web. These themes are similar to using a style page and setting the background properties for pages to use this style page, with one minor exception: FrontPage 98 will automatically apply this to all pages in the website, a definite time saver.

Finally, there's the "Tasks" icon. This is particularly useful if the web is being multi-authored, and/or is a large web. Or maybe you just have a lot of clients. This again, was a feature of FrontPage 97, but is improved in FrontPage 98.

Frontpage Editor

FrontPage Editor has a great number of improvements. Let's start with the editing window. It now has tabs, 3 of them:

  1. Normal: The Normal view is similar to the Normal view of FrontPage 97, with perhaps one big exception. You can now edit an entire frameset, including the frameset itself, in WYSIWYG fashion.

  2. HTML: The HTML view is similar to the HTML view of FrontPage 97 at fiurst glance. However, the FrontPage 97 HTML editor was not extrememly user-friendly. In fact, it was a lousy text editor. You had to use shortcut keys to, for instance, cut, copy, or paste text. there were none of the typical text editor commands available. The HTML editor in FrontPage has it all.

  3. Preview: The Preview tab works just like a browser, in terms of how the pages look, and to a certain extent, how they operate. It isn't quite as functional as a browser; some active components don't work very well in the preview pane, but its' purpose is to give you an idea of how the page will look when it's viewed in a browser, and it does just that - quickly and easily.

New FrontPage Components (in FrontPage 97 these were called WebBots) have been added:

  1. Hover Buttons: These are buttons which are graphic, and change in their appearance when the mouse cursor is over them. They can also play sounds when the ounse is over them, or when clicked. They activate the URL which you specify when they are clicked. These buttons are pretty cool, as they are Java applets. If you've ever used Javascript to change an image when the mouse is over it, you probably know that the images array isn't supported by Internet Explorer 3x and below. The Java applets make the Hover Buttons available to any browser supporting Java applets, which is about 95% or so.

  2. Banner Ad Manager: This component allows you to create Banner Ads of images which change at intervals which you specify. You can also specify a URL to which the Banner Ad points.

FrontPage Editor has numerous improvements over FrontPage 97 with existing features as well. tables, for example, can be drawn or edited, If you use Themes for your web, you can set individual themes for pages in FrontPage Editor.

Active Server Pages

FrontPage 98 is designed to support Active Server Pages. The Script dialog has a checkbox to create ASP tags. These tags contain scripting which is run on the server to create dynamic web pages according to a plethora of possibilities, most especially for interaction with databases.

Lab