Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
NOTE: You may receive an error message if you copy the examples
directly from this article and paste them into FrontPage. The angle brackets
(< and >) may appear as escaped HTML code (< and >). To work around
this behavior, paste the script into a blank Notepad document, and then copy it
from Notepad before you paste it into FrontPage.
Code Sample
In a new page in FrontPage, follow these steps to use the
Calendar Control to populate a text box in an HTML form:
- Insert a form on the page.
To insert a form on
your new page, follow these steps:
- On the Insert menu, point to Form and then click Textbox.
- Double-click the text box. In the Text Box Properties dialog box, change the Name box to txtDate.
- Click OK to close the Text Box Properties dialog box.
- Right-click the form, and then select Form Properties.
- Type MyForm in the Form
name field.
- Click OK to close the Form Properties dialog box.
- Insert the Calendar Control on the page.
To
insert the Calendar control on your page, follow these steps:
- On the Insert menu, click Web Component.
- In the Insert Web Component dialog box, click Advanced Controls in the Component type list, and then click ActiveX Control. Click Next.
- In the Choose a control list, click Calendar Control 10.0, and then click Finish.
- Add a script to the Calendar Control.
To add a
script to the Calendar Control, follow these steps:
- Click the HTML tab.
- Insert the following code under the <BODY> tag:
<SCRIPT LANGUAGE="vbscript">
<!--
Sub Calendar1_Click()
MyForm.txtDate.value = Calendar1.Value
End Sub
-->
</SCRIPT>
When you preview your Web page, as you click dates in the
calendar, the text box will be populated with the date
selected.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.