Pieter Lamers
|
| Posted: 03/17/2003, 7:55 AM |
|
I use a form for data entry with a search field for the primary key and a master/detail form. When the user wants to search for a specific primary key, it would be nice if he could press a button that launches a popup with a search grid. The popup grid has to return the clicked primary key and put it in the search field of the calling form.
Hope anybody has some tips!!!
I'm familiar to VB and therefore using ASP. However.. i'm not so good in HTML and ASP....
|
|
|
 |
RonB
|
| Posted: 03/18/2003, 6:09 AM |
|
1. create the search page that will be loaded into the popup.
in the head section(html view) add the folowing code:
<script language="JavaScript">
function goGetit()
{
opener.document.all.your_controlname.value=this.value
}
</script>
in the result box on the popup add(in html) onchange="goGetit()"
On the original page you'll have to add a button with search on it. in html add :
onclick="window.open('searchpage.asp', 'sub', 'HEIGHT=400 WIDTH=400 left=80 top=80')
Ron
|
|
|
 |
Pieter Lamers
|
| Posted: 03/24/2003, 2:27 AM |
|
Ron, thanks for the fast respons. Because I use VB I did put your code in functions and now I get the popup window. However, I can't make the goGetit(0 to put a value in the control (textbox in searchform) on page A. I tried opener.document.forms['Searchform1'].s_tableID.value="XXX" (saw this in an article at CodeChargers.net) but this also didn't work.
I get "forbidden" message in the popup window. Probably because I don't know how to call the geGetit() in form B.
What do you mean with "the result box on the popup" ??? I would like to use a linked (ID-)field in the grid to activate the goGetit().
Thanks,
Pieter.
|
|
|
 |
|