Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Parameter from list Popup -- So Close

Status
Not open for further replies.

Moonpie10

Programmer
Joined
Feb 22, 2005
Messages
14
Location
US
Hi All,
I have a jsp(1) that when a button is clicked brings up jsp(2) which is a search page. Jsp(2) shows a list and when a user clicks on an item in the list jsp(2) closes and should populate a field on jsp(1). It is partially working, I am gettin "undefined" in the jsp(1) field instead of the user's selection. Can someone take a look and see if they can spot the problem? Thanks!

<script>
function closeSearch(sourceobj, destinationObj){
destinationObj.value=sourceobj.value;
window.close();
}

function openSearch(obj){
window.open("AcctSearch.jsp?newpartner=" + obj.value,"AcctSearch", "width=500 height=300, menubar=no,resizable=no,scrollbars=yes")
}
</script>

out.println("<td class=\"tabletextcol\"><a href=\"javascript:void(0)\"onClick=\"parent.closeSearch(search,opener.document.all.newpartner)\"><TEXTAREA name=\"search\">" + account.getOrg() + "</TEXTAREA></a></td>");
 
destinationObj is the "newpartner" input field on the parent form and sourceobj is the selection from the out.println..etc
 
you can't have an <a>nchor tag around a textarea, that just doesn't make sense.

what about something like this:

Code:
<a href="#" onclick="parent.closeSearch(document.getElementById('search').value, opener.document.getElementById('newpartner'); return false;">Copy To Parent Window</a><br />
<textarea name="search" id="search"></textarea>

Code:
closeSearch( val, targ ) {
    targ.value = val;
}

*cLFlaVA
----------------------------
[tt]your mom goes to college[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top