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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTimePicker problem

Status
Not open for further replies.

mdupreez

Programmer
Dec 19, 2003
7
ZA
Can someone PLEASE help me!
I use a DTPicker in a form using ASP and it is Ok when I'm trying to open it localy through Visual Interdev. Scripting is working (so I can set and get DTPicker values from the Javascript via the document.<formname>.<DTPickerID>.Month,Year,Day).

But problems start when I'm trying get same document over the http. Error says &quot;this method or Property is not supported by this object&quot;.

Any Ideas??

Thank You,
Marianne
 
We're going to need more specifics to figure this one out... Can you post the relavant code? Can you figure out which javascript line/function is throwing the error?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Thank you very much for helping me!
A segment of the Jscript follows:

function PrepareSubmit2() {

FilterForm.action= &quot;Reports/general_report_nobusy.rpt&quot;;
FilterForm.prompt5.value = &quot;2&quot;;

BeginDate = FilterForm.BeginDate;
EndDate = FilterForm.EndDate;

FilterForm.promptOnRefresh.value = &quot;1&quot;;
FilterForm.init.value = FilterForm.Format.value;
FilterForm.prompt2.value = FilterForm.Interval.value;
FilterForm.prompt3.value = FilterForm.txtParam.value;
FilterForm.prompt4.value = FilterForm.Recording.value;

//The problem occurs here with BeginDate.Year
date_param = BeginDate.Year + &quot;,&quot; + BeginDate.Month + &quot;,&quot; + BeginDate.Day;

time_param = BeginDate.Hour + &quot;,&quot; + BeginDate.Minute + &quot;,&quot; + BeginDate.Second;

FilterForm.prompt0.value = &quot;DateTime(&quot; + date_param + &quot;,&quot; + time_param + &quot;)&quot;;

date_param = EndDate.Year + &quot;,&quot; + EndDate.Month + &quot;,&quot; + EndDate.Day;

time_param = EndDate.Hour + &quot;,&quot; + EndDate.Minute + &quot;,&quot; + EndDate.Second;

FilterForm.prompt1.value = &quot;DateTime(&quot; + date_param + &quot;,&quot; + time_param + &quot;)&quot;;

return true;
}

The strange thing is that 2 years ago, this code worked properly. Was there anything changed in the handling of the DateTimePicker objects over the past few years? Is there a specific file or application that has to be present on the workstation in order for it to work? Is there a setting somewhere that causes this? I have searched the web for 2 days and can't find anything.

Thanks again!
Marianne
 
does the following alert() return [object]?

function PrepareSubmit2() {

FilterForm.action= &quot;Reports/general_report_nobusy.rpt&quot;;
FilterForm.prompt5.value = &quot;2&quot;;

BeginDate = FilterForm.BeginDate;
alert (BeginDate)

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
If we know that the error lies here, let's look at each part...

alert(BeginDate.Year)
alert(BeginDate.Month)
alert(BeginDate.Day)
date_param = BeginDate.Year + &quot;,&quot; + BeginDate.Month + &quot;,&quot; + BeginDate.Day;

which doesn't work?
is it possible that the BeginDate hasn't been loaded properly?




Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
It gives the same error than before when coming to
alert(BeginDate.Year);
The error is &quot;object doesn't support this property or method&quot;
 
can you show us the code that forms the BeginDate object and the code that loads it?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
creation of object:
<OBJECT id=BeginDate style=&quot;WIDTH: 158px; HEIGHT: 23px&quot;
classid=clsid:20DD1B9E-87C4-11D1-8BE3-0000F8754DA1 VIEWASTEXT><PARAM NAME=&quot;_ExtentX&quot; VALUE=&quot;4180&quot;><PARAM NAME=&quot;_ExtentY&quot; VALUE=&quot;609&quot;><PARAM NAME=&quot;_Version&quot; VALUE=&quot;393216&quot;><PARAM NAME=&quot;MousePointer&quot; VALUE=&quot;0&quot;><PARAM NAME=&quot;Enabled&quot; VALUE=&quot;1&quot;><PARAM NAME=&quot;OLEDropMode&quot; VALUE=&quot;0&quot;><PARAM NAME=&quot;CalendarBackColor&quot; VALUE=&quot;-2147483643&quot;><PARAM NAME=&quot;CalendarForeColor&quot; VALUE=&quot;-2147483630&quot;><PARAM NAME=&quot;CalendarTitleBackColor&quot; VALUE=&quot;-2147483633&quot;><PARAM NAME=&quot;CalendarTitleForeColor&quot; VALUE=&quot;-2147483630&quot;><PARAM NAME=&quot;CalendarTrailingForeColor&quot; VALUE=&quot;-2147483631&quot;><PARAM NAME=&quot;CheckBox&quot; VALUE=&quot;0&quot;><PARAM NAME=&quot;CustomFormat&quot; VALUE=&quot;yyyy/MM/dd HH:mm:ss&quot;><PARAM NAME=&quot;DateIsNull&quot; VALUE=&quot;0&quot;><PARAM NAME=&quot;Format&quot; VALUE=&quot;662831107&quot;><PARAM NAME=&quot;UpDown&quot; VALUE=&quot;0&quot;><PARAM NAME=&quot;CurrentDate&quot; VALUE=&quot;37977&quot;><PARAM NAME=&quot;MaxDate&quot; VALUE=&quot;2958465&quot;><PARAM NAME=&quot;MinDate&quot; VALUE=&quot;-109205&quot;></OBJECT>

This code is situated in the ASP file. The object is then called by the JScript for the transferring of parameters to the report. This code I posted earlier.

It all works perfectly when called via the Quickview option in Visual Interdev. But when calling the ASP through Internet Explorer, like it is supposed to be done in the future, it doesn't work.

I just want to say thanks very much for your effort. I couldn't find anyone who can sort out the problem and I'm starting to get really frustrated.
 
It looks like your object is not receiving the value correctly. BeginDate is seen as an object but the attributes aren't making it.


What do these get you?


BeginDate = FilterForm.BeginDate;
alert(FilterForm.BeginDate)
alert(BeginDate.toString())



Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Both those alerts return [object].
Do you perhaps know of any licensing issues or something similar with ActiveX controls like the DateTimePicker that I'm using? This could explain why it's functioning properly inside the context of the Interdev environment, but not outside when loading it with Internet Explorer. Are there any additional installations or settings that has to be configured?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top