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.toStri ng().indexOf('# ');
String xstring=x.toStr ing().substring (indexX+1);
Object y = resb.get("y");
int indexY=y.toStri ng().indexOf('# ');
String ystring=y.toStr ing().substring (indexY+1);
Object z = resb.get("z");
int indexZ=z.toStri ng().indexOf('# ');
String zstring=z.toStr ing().substring (indexZ+1);
Object a = resb.get("a");
int indexA=a.toStri ng().indexOf('# ');
String astring=a.toStr ing().substring (indexA+1);
Object b = resb.get("b");
int indexB=b.toStri ng().indexOf('# ');
String bstring=b.toStr ing().substring (indexB+1);
out.println("<t r><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(ast ring+ "'></td><td>Temp Title:</td><td><inpu
type='text' readonly size='25' value='" +zstring
"'></td><td>Deposito r</td><td><input type='text' readonly size='15
id='getDep' value='");
out.println(bst ring+"'></td><td><input type='button
value='Choose'" );
out.println("on click=\"window. opener.NewDescr iptionForm.Desc ABE.value=getEl ementById('getA BE').value;wind ow.opener.NewDe scriptionForm.D escAEE.value=ge tElementById('g etAEE').value;w indow.opener.Ne wDescriptionFor m.DescDepositor .value=getEleme ntById('getDep' ).value;window. close()\";></td></tr>");
}
} //end i
zapounidou
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message43021.htm
Comment