artisstcollier
Programmer
I am currently trying to find a way to modify a short snippet of code that opens a child popup window, and when a link is selected, that link path is inserted in a textfield with an id on the parent page.
I am trying to use 4 textfields, each with its own unique id but can't get it to work by copying and pasting the code 3 times and supplementing each id with the cooresponding textfield.
The following is the snippet:
The textfield is:
<input type="text" name="header" id="if_url"" size="5">
This works fine but I need it to work with 3 more textfields such as:
<input type="text" name="header" id="if_tnav" size="5">
<input type="text" name="header" id="if_lnav" size="5">
<input type="text" name="header" id="if_rnav" size="5">
Any help would be appreciated.
I am trying to use 4 textfields, each with its own unique id but can't get it to work by copying and pasting the code 3 times and supplementing each id with the cooresponding textfield.
The following is the snippet:
Code:
<script type="text/javascript">
function WantThis(url) {
window.opener.document.getElementById('if_url').value = url;
window.close();
}
</script>
<input type="text" name="header" id="if_url"" size="5">
This works fine but I need it to work with 3 more textfields such as:
<input type="text" name="header" id="if_tnav" size="5">
<input type="text" name="header" id="if_lnav" size="5">
<input type="text" name="header" id="if_rnav" size="5">
Any help would be appreciated.