Click to See Complete Forum and Search --> : Passing VALUES from POP UP WINDOW
Hi there!
I dont know if this is possible or not, but i just thought id check anyways!
I have a form on an ASP page, there is link on this form to a pop up window, ive a recordset writing to the popup page with mutliple values in hyperlinks, basically i want to pass a value from to the POP window to a text field on the form when one of the values is clicked, can anyone show me a really really basic example of this?
Thanks
Eire :confused:
SlankenOgen
07-21-2003, 06:52 AM
opener.document.formName.fieldName.value =
opener.document.formName.fieldName.value =
is this applied to the HREF tag? on the parent or child page?
thanks for your reply!
SlankenOgen
07-21-2003, 07:27 AM
In the popup put
function f(){
opener.document.formName.fieldName.value = "hello";
return false;
}
on the href (in the popup) put-
<a href = "#" onclick = "f();return false;">link</a>
excellent that works!
so how do i populate the text field with hyperlink values that i have in my recordset?
SlankenOgen
07-21-2003, 07:59 AM
It depends on where the record set is - is it an array? In the opener?
thansk for your help on this.
the record set is on the child page.
i have it returning the links to parente page now, but its returning the first item at the top of the record set!
SlankenOgen
07-21-2003, 09:07 AM
Can you post the record set? Is it an array?
this is code i have.
Cheers
eire
<script language="JavaScript" type="text/JavaScript">
<!--
function close_window() {
window.close();
}
//-->
function f(){
opener.document.form1.LocString.value = "<%= RsGetbooks.Fields.Item("").Value %>";
return false;
}
</script>
This is the record set
select * from tbllib_books where booknumber like @booknum + '%' order by ID
This is link
<a href = "#" onClick = "f();return false;"><%= RsGetbooks.Fields.Item("").Value %></a>
SlankenOgen
07-21-2003, 09:38 AM
function f(){
var str = "<%= RsGetbooks.Fields.Item("").Value %>";
alert(str);// make sure it is being set.
opener.document.form1.LocString.value = str;
its an ASP page it dosent seem to like the "
ive fixed the quotes bit.
hmmmmmmmmmm this is so strange, its still selecting the first record.
SlankenOgen
07-21-2003, 10:54 AM
You'll need to post in the asp forum.
Thanks for your help, I think i might have it sorted.