Hi there,

I inserted a Calendar Control 10.0 into my FrontPage 2003.

I can display it however, I was unable to retrive my selected date value.

I don't see a property called Value when I use the "." operator.

If I use the sample code from article 299691, I got an Error: Object
required: 'Calendar1'

Did I use an incorrect version of Calendar Control on FrontPage 2003?

Any idea?

Thanks.

Abel Chan

RE: ActiveX Calendar Control On FrontPage 2003 by v-kevy

v-kevy
Wed Jan 05 20:36:46 CST 2005

Hi Abel,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you were unable to get the value from
Calendar Control. If there is any misunderstanding, please feel free to let
me know.

Based on the error message, I assume that you didn't set an id for the
Calendar control. You can try to add an id for the control in HTML view
like:

<object classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" id="Calendar1">

Or you can right click the control on design view and set the id in the
ActiveX control properties dialog.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


RE: ActiveX Calendar Control On FrontPage 2003 by awong

awong
Thu Jan 06 12:35:05 CST 2005

Hi Kevin,

I do have the classid. I have included the HTML code below.

Thanks.

Abel Chan

<object classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" id="Calendar1">
<param name="BackColor" value="-2147483633">
<param name="Year" value="2005">
<param name="Month" value="1">
<param name="Day" value="6">
<param name="DayLength" value="1">
<param name="MonthLength" value="1">
<param name="DayFontColor" value="0">
<param name="FirstDay" value="7">
<param name="GridCellEffect" value="1">
<param name="GridFontColor" value="10485760">
<param name="GridLinesColor" value="-2147483632">
<param name="ShowDateSelectors" value="-1">
<param name="ShowDays" value="-1">
<param name="ShowHorizontalGrid" value="-1">
<param name="ShowTitle" value="-1">
<param name="ShowVerticalGrid" value="-1">
<param name="TitleFontColor" value="10485760">
<param name="ValueIsNull" value="0">
</object>

<script language=vbscript>
sub Calendar1_OnClick
rem Try to retrieve selected date value. Calendar1.value is an invalide
statement.
rem msgbox Calendar1.value
end sub
</script>




"Kevin Yu [MSFT]" wrote:

> Hi Abel,
>
> First of all, I would like to confirm my understanding of your issue. From
> your description, I understand that you were unable to get the value from
> Calendar Control. If there is any misunderstanding, please feel free to let
> me know.
>
> Based on the error message, I assume that you didn't set an id for the
> Calendar control. You can try to add an id for the control in HTML view
> like:
>
> <object classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" id="Calendar1">
>
> Or you can right click the control on design view and set the id in the
> ActiveX control properties dialog.
>
> HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>

Re: ActiveX Calendar Control On FrontPage 2003 by Michael

Michael
Thu Jan 06 14:03:00 CST 2005

> ...
> <script language=vbscript>
> sub Calendar1_OnClick
> rem Try to retrieve selected date value. Calendar1.value is an
> invalide statement.
> rem msgbox Calendar1.value

You probably get that error because the <object> element itself (as opposed
to the ActiveX object it is exposing) does not have a value property.

For object's that expose properties with names that match common html
element attribute names (like value), you should be able to use the syntax

Calendar1.object.value

to get at the underlying object's value property. The object attribute of
and object element exposes the contained object, i.e., the calendar control
in this case.

> end sub
> </script>

--
Michael Harris
Microsoft.MVP.Scripting


Re: ActiveX Calendar Control On FrontPage 2003 by awong

awong
Thu Jan 06 15:13:04 CST 2005

Hi Michael,

Thanks to your email.

I understand why I got the error message.

I just don't know what should be the correct syntax to retrieve/to pick the
Calendar date.

I searched and the solution I can find so far is using Java date picker:
http://www.itechcentral.net/java/Calendars/popup-date-picker.html

I would be very surprise if I can't pick the date I want with the Calendar
control.

Any idea?

Thanks.

Abel Chan



"Michael Harris (MVP)" wrote:

> > ...
> > <script language=vbscript>
> > sub Calendar1_OnClick
> > rem Try to retrieve selected date value. Calendar1.value is an
> > invalide statement.
> > rem msgbox Calendar1.value
>
> You probably get that error because the <object> element itself (as opposed
> to the ActiveX object it is exposing) does not have a value property.
>
> For object's that expose properties with names that match common html
> element attribute names (like value), you should be able to use the syntax
>
> Calendar1.object.value
>
> to get at the underlying object's value property. The object attribute of
> and object element exposes the contained object, i.e., the calendar control
> in this case.
>
> > end sub
> > </script>
>
> --
> Michael Harris
> Microsoft.MVP.Scripting
>
>

Re: ActiveX Calendar Control On FrontPage 2003 by v-kevy

v-kevy
Fri Jan 07 02:10:23 CST 2005

Hi Abel,

To narrow down the problem, here I added a button to display the value of
Calendar Control. The following is the whole HTML page. Please try to see
if you can get the date by clicking on that button.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>NewPage</title>
<meta name="Microsoft Theme" content="compass 1011, default">
</head>
<body>
<script language="vbscript">
sub getval
rem Try to retrieve selected date value. Calendar1.value is an
invalide statement.
msgbox Calendar1.value
end sub
</script>
<p>
<object classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" id="Calendar1">
<param name="BackColor" value="-2147483633">
<param name="Year" value="2005">
<param name="Month" value="1">
<param name="Day" value="7">
<param name="DayLength" value="1">
<param name="MonthLength" value="1">
<param name="DayFontColor" value="0">
<param name="FirstDay" value="7">
<param name="GridCellEffect" value="1">
<param name="GridFontColor" value="10485760">
<param name="GridLinesColor" value="-2147483632">
<param name="ShowDateSelectors" value="-1">
<param name="ShowDays" value="-1">
<param name="ShowHorizontalGrid" value="-1">
<param name="ShowTitle" value="-1">
<param name="ShowVerticalGrid" value="-1">
<param name="TitleFontColor" value="10485760">
<param name="ValueIsNull" value="0">
</object>
<input type=Button value="button" onclick="getval" />
</p>
</body>
</html>

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."