Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calender Picker Activex and HTML

Status
Not open for further replies.

Tusk

Technical User
Oct 21, 2002
48
GB
Hi,

Bear with me if this is a muppet question, I'm not a programmer so would appriciate some help. I have a web form that I want to use the Date and Time Picker ActiveX control to set the date and time for various actions. I can successfully caode the control into the page and it displays just fine.

What I can't work out is how to pass the date or time selected into the variable to post with the form. Can anyone enlighten me with some code?

Many thanks

Confused of Trowbridge
 
<script language=&quot;VBScript&quot;>
Sub OnBtnClick()
msgbox Calendar1.Day & &quot;-&quot; & Calendar1.Month & &quot;-&quot; & Calendar1.Year
End Sub
</script>
<html>

<head>
<title>How to use MS Calendar Activex Control</title>
</head>

<body>

<p>
<object classid=&quot;clsid:8E27C92B-1264-101C-8A2F-040224009C02&quot; id=&quot;Calendar1&quot; width=&quot;288&quot; height=&quot;192&quot;>
<param name=&quot;_Version&quot; value=&quot;524288&quot;>
<param name=&quot;_ExtentX&quot; value=&quot;7620&quot;>
<param name=&quot;_ExtentY&quot; value=&quot;5080&quot;>
<param name=&quot;_StockProps&quot; value=&quot;1&quot;>
<param name=&quot;BackColor&quot; value=&quot;-2147483633&quot;>
<param name=&quot;Year&quot; value=&quot;2003&quot;>
<param name=&quot;Month&quot; value=&quot;5&quot;>
<param name=&quot;Day&quot; value=&quot;22&quot;>
<param name=&quot;DayLength&quot; value=&quot;1&quot;>
<param name=&quot;MonthLength&quot; value=&quot;2&quot;>
<param name=&quot;DayFontColor&quot; value=&quot;0&quot;>
<param name=&quot;FirstDay&quot; value=&quot;1&quot;>
<param name=&quot;GridCellEffect&quot; value=&quot;1&quot;>
<param name=&quot;GridFontColor&quot; value=&quot;10485760&quot;>
<param name=&quot;GridLinesColor&quot; value=&quot;-2147483632&quot;>
<param name=&quot;ShowDateSelectors&quot; value=&quot;-1&quot;>
<param name=&quot;ShowDays&quot; value=&quot;-1&quot;>
<param name=&quot;ShowHorizontalGrid&quot; value=&quot;-1&quot;>
<param name=&quot;ShowTitle&quot; value=&quot;-1&quot;>
<param name=&quot;ShowVerticalGrid&quot; value=&quot;-1&quot;>
<param name=&quot;TitleFontColor&quot; value=&quot;10485760&quot;>
<param name=&quot;ValueIsNull&quot; value=&quot;0&quot;>
</object>
</p>

<p>
 
<input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;B1&quot; OnClick=&quot;OnBtnClick&quot; >
</p>
</form>

</body>

</html>


Cracky -= Developer/DBA =-
visit :
 
Yeah, then add this:

Code:
<script LANGUAGE=&quot;javascript&quot; FOR=&quot;Calendar1&quot; EVENT=&quot;Click&quot;>
<!--
 Calendar1_Click()
//-->
</script>
<SCRIPT LANGUAGE=javascript> 
function Calendar1_Click() {
	try{
		var dt = new Date( Calendar1.Value);
		if( !isNaN(dt)){
			document.form1.dtView.value = dt.toString();
			document.form1.action = &quot;default.asp&quot;;
			document.form1.submit();
		}
	}catch(e){}
}
</script>
<form id=&quot;form1&quot; name=&quot;form1&quot; ... >
<input type=&quot;hidden&quot; id=&quot;dtView&quot; name=&quot;dtView&quot; />
</form>

-pete
 
Thanks to you both for replying, it now works

-Tusk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top