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

Customized Date-picker error 1

Status
Not open for further replies.

pgferro

Programmer
Aug 21, 2001
111
BS
Hi,

I'm using the famous date-picker.js for one of my pages, where I have 2 form fields with dates to be picked-up.
My goal is to assign to a third form field the day difference between the two dates. I've tried to trigger the function from an 'onchange' event, but the date-picker assigns the date.value from a different window, so it doesn't work.
So i opened the js, and immediately before the window.close command, i called a function to serve the purpose.
Problem is I get an 'objet expected' error, even with the most simple of the function... here a snippett :

Code:
function testme(){
   alert('Test');
}

--snip--
for (j=0; j<7; j++) {
			vCode = vCode + &quot;<TD WIDTH='14%'&quot; + this.write_weekend_string(j) + &quot;><FONT SIZE='2' FACE='&quot; + fontface + &quot;'>&quot; + 
				&quot;<A HREF='#' &quot; + 
					&quot;onClick=\&quot;self.opener.document.&quot; + this.gReturnItem + &quot;.value='&quot; + 
					this.format_data(vDay) + 
					&quot;';testme();window.close();\&quot;>&quot; + 
				this.format_day(vDay) + 
				&quot;</A>&quot; + 
				&quot;</FONT></TD>&quot;;
			vDay=vDay + 1;
--snip--
I'm breaking my head on this... pls help !

Thanks
 
is testme() in the same document as the date picker?

if it's in the opener document, call it like so:

opener.testme();



=========================================================
while (!succeed) try();
-jeff
 
jemminger,

I put the function in the opener document and it works!

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top