I have a form that when the user clicks on button calls a servlet
that performs a query on a database and displays the results on a ne
window.
The user selects from the new window and with the use of javascrip
some values from
the second window pass to the first one.
The problem is that nomatter what button I choose the same value i
passed to the first window.
Javascript returns only the first row values.
I think that onClick has the problem, but how i can make choose butto
to retrieve only the
values of its row?
How can I solve this problem? Thanks
here is my code:
for (Iterator iter = results; iter.hasNext();)
{ ResultBinding resb = (ResultBinding)iter.next();
Object x = resb.get("x");
int indexX=x.toString().indexOf('#');
String xstring=x.toString().substring(indexX+1);
Object y = resb.get("y");
int indexY=y.toString().indexOf('#');
String ystring=y.toString().substring(indexY+1);
Object z = resb.get("z");
int indexZ=z.toString().indexOf('#');
String zstring=z.toString().substring(indexZ+1);
Object a = resb.get("a");
int indexA=a.toString().indexOf('#');
String astring=a.toString().substring(indexA+1);
Object b = resb.get("b");
int indexB=b.toString().indexOf('#');
String bstring=b.toString().substring(indexB+1);
out.println("<tr><td>ABE:</td><td><input type='text' readonl
size='5' id='getABE' value='" +ystring+ "'></td><td>AEE:</td><td><inpu
type='text' size='15' readonly id='getAEE' value='");
out.println(astring+ "'></td><td>Temp Title:</td><td><inpu
type='text' readonly size='25' value='" +zstring
"'></td><td>Depositor</td><td><input type='text' readonly size='15
id='getDep' value='");
out.println(bstring+"'></td><td><input type='button
value='Choose'");
out.println("onclick=\"window.opener.NewDescriptio nForm.DescABE.value=getElementById('getABE').value ;window.opener.NewDescriptionForm.DescAEE.value=ge tElementById('getAEE').value;window.opener.NewDesc riptionForm.DescDepositor.value=getElementById('ge tDep').value;window.close()\";></td></tr>");
}
} //end i
zapounidou
-----------------------------------------------------------------------
Posted via
http://www.mcse.m
-----------------------------------------------------------------------
View this thread:
http://www.forum4designers.com/message43021.htm