By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,712 Members | 2,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,712 IT Pros & Developers. It's quick & easy.

writing a variable to an other document

P: n/a
hello,

i have a page called 'a.php'.
on this page is a form with a textfield and a link.

if you click the link an pop up opens.
in this pop up is an number visible with a link.

what i want is this:
when you click the link in the pop up, the number from
the pop up must appear in the textfield from page a.php.

i tried:
a javascript under the link in the pop up with:

function brinnummer(nummer){
document[0].getElementById('brinnummer')[0].value = nummer;
}

but it doesnot work,

thanks
Oct 11 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
function brinnummer(nummer) {
window.opener.document.getElementById('brinnummer' ).value = nummer;
}

and make sure the id='brinnummer' is added to the <input> tag of your
textfield.

;-)

Oct 11 '05 #2

P: n/a

"Joop" <jc*****@hotmail.com> schreef in bericht
news:11**********************@g47g2000cwa.googlegr oups.com...
function brinnummer(nummer) {
window.opener.document.getElementById('brinnummer' ).value = nummer;
}

and make sure the id='brinnummer' is added to the <input> tag of your
textfield.

;-)


hello joop,

i have made the changes that you suggested but it doesn't work.

here is the code i use:

-------------------first page----------------------------------
<html>
<head><title>mooie pagina</title>

<script type="text/javascript">
function popupOpenen(){
win=window.open("basaalVenster.php","","top=153,le ft=5,
width=360px, height=380px, scrollbars=yes");
}

</script>
</head>
<body>
<form >
brinnummer <input id='brinnummer' type='text'
name='hetNummer'>
</form>

<a href=javascript:popupOpenen()>open popup</a>
</body>
</html>
--------------------------------------------------------------------

--------------------- pop up page ----------------------------------
<html>
<head><title>mooie pagina</title>

<script type="text/javascript">
<!-- sluit venster bij verlaten pagina -->
function brinnummer(nummer){
window.opener.document.getElementById('brinnummer' ).value = nummer;
}
</script>
</head>
<body>

<a href=javascript:brinnummer('popup-qq44')>toon nummer</a>

</body>
</html>
-------------------------------------------------------------------------

thanks,



Oct 11 '05 #3

P: n/a


hello joop,

i have made a mistake: i works great,

thank you very much

nescio
Oct 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.