Forum Moderators: open

Message Too Old, No Replies

Need a link from a popup to fill in another windows form

using asp.net how?

         

ASPhopeful

1:50 pm on Sep 23, 2004 (gmt 0)

10+ Year Member



Hi all,

I have previously (in Classic ASP) created an nth tier categorisation tree from web directories and such like. I am now moving over to ASP.net with a new project and need to do something similar. I am a little stuck on a small piece of functionality that i need though. Here's the process I require.

User fills out form.
When user gets to category section they click on a link that opens a popup.
The popup displays top tier categories.
The click on a category and it reloads with the sub categories. (which keeps going till they find the correct category n tiers down).
[WHERE I GET STUCK]
User selects the category.
Popup closes.
Original form that is in background is populated with the ID of the category they selected.
[/WHERE I GET STUCK]

I can create the popup and get it displaying the category tree. It's the point where the value needs to transfer that I get stuck.

Can anyone help.

Thanks.
Helen.

ASPhopeful

2:35 pm on Sep 23, 2004 (gmt 0)

10+ Year Member



I've now solved this.

The pop-up has the following code in the header

<script language="javascript">
function SelectCat(categorycode) {
var txtarea = window.opener.document.forms[0].frmCategoryID;
txtarea.value = categorycode;
txtarea.focus();
self.close();
}
</script>

And each link has a href like follows

<a href="JavaScript:SelectCat('1001')">Select Category 1001</a>

Helen