Forum Moderators: open

Message Too Old, No Replies

Getting Values from a window to parent page

         

vjy143

5:27 am on Apr 13, 2005 (gmt 0)

10+ Year Member



Hi,

I am having a jsp page which includes another jsp page. eg

a.jsp includes b. jsp. a.jsp has one form and b.jsp has another form.

a.jsp
-----
<html>

<%@ include file="b.jsp"%>
<form name = aaaaa>

</form>

</html>

b.jsp
-----
<html>
<form name = bbbbb>

</form>

</html>

And in b.jsp I have a icon, its a calendar icon, which on clicking will open a new window (date.jsp page with another form name). What I want is I want to set the date selected from the date.jsp to a.jsp.

I am able to get the values, but the only problem is I am not able to set it to a.jsp.

I am using this function in date.jsp

function getDateFun(year, month, day) {

alert(year);
alert(month);
alert(day);
//alert("dateType: "+dateType);
var vDate = month+"/"+day+"/"+year;

alert("vDate: "+vDate);

window.opener.bbbbb.FromDate.value = vDate;
//parent.opener.FromDate.value = vDate;
window.close();
}

But I am able to get the value updated if the calender image is in the same page, ie in a.jsp. BUt it cannot be like that.

Any help would be of great help.

Thanks

Rambo Tribble

1:20 pm on Apr 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think you are missing 'document' from your scope chain, as in: opener.document.formName.~etc.

Bernard Marx

3:37 pm on Apr 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Careful with the ~, Mr. Tribble.
It's dangerous.

Rambo Tribble

4:15 pm on Apr 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With a name like "Rambo", I think I'm obligated to display a certain wanton disregard for syntactic safety.