A form object "vendor_id" is passed to a pop-up window thru a JavaScript function. I retrieved the value of the passed object in the pop-up window fine, but failed to put the var into a JSP statement.
Your input would be appreciated.
======================================================================
The JSP with the JavaScript function (partial):
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function PopUpWindow() {
showModalDialog('called.jsp',InvForm.vendor_id.value,'status:No;help:No;resizable:Yes;dialogWidth:690px;dialogHeight:200px;dialogLeft=220px;dialogTop=375px');
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="InvForm" METHOD="post" ACTION="doSUBMIT.jsp">
.
.
<TABLE>
<TR>
<TD>
<INPUT TYPE="text" NAME="inv_no" SIZE="15" VALUE="<%= sa[17] %>">
<A HREF="#" onClick="PopUpWindow()"><IMG SRC="/webapp/images/LOV.gif" BORDER=0 ALIGN=absmiddle></A>
</TD>
<TD><INPUT TYPE="hidden" NAME="vendor_id" SIZE="20" VALUE="<%= sa[16] %>"></TD>
</TR>
.
.
<TABLE>
<input type="Submit" NAME="save" value="SAVE">
</FORM>
</BODY>
</HTML>
======================================================================
called.jsp: the "vendor_id" is correctly passed and has been put into an object ("vendor_id"in the form. How to put "vendor_id" in a JSP statement so that its value can be passed to a JavaBean? The statement <% xvendor_id = request.getParameter("vendor_id" %> does not work since "vendor_id" didn't get here thru the POST method.
<HTML>
<HEAD>
<SCRIPT>
window.onload=fnInit;
function fnInit()
{
oVendorId.innerHTML=dialogArguments;
document.InvoiceForm.vendor_id.value = oVendorId.innerHTML;
}
</SCRIPT>
</HEAD>
<BODY>
<H4>Invoice List for Vendor Id <SPAN ID="oVendorId"></SPAN></H4>
<FORM NAME="InvoiceForm" METHOD="post" ACTION="WindowClose.jsp">
<TABLE>
<%! String xvendor_id; %>
<% xvendor_id = request.getParameter("vendor_id" %>
<% if (xvendor_id != null) { %>
<% util.connect(); %>
<% String[] [] invoice = select.getInvInfo(xvendor_id); %>
.
.
<% }%>
<TR><TD><SPAN><INPUT TYPE="hidden" NAME="vendor_id"></SPAN></TD></TR>
</TABLE>
</FORM>
</BODY>
</HTML>
Your input would be appreciated.
======================================================================
The JSP with the JavaScript function (partial):
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function PopUpWindow() {
showModalDialog('called.jsp',InvForm.vendor_id.value,'status:No;help:No;resizable:Yes;dialogWidth:690px;dialogHeight:200px;dialogLeft=220px;dialogTop=375px');
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="InvForm" METHOD="post" ACTION="doSUBMIT.jsp">
.
.
<TABLE>
<TR>
<TD>
<INPUT TYPE="text" NAME="inv_no" SIZE="15" VALUE="<%= sa[17] %>">
<A HREF="#" onClick="PopUpWindow()"><IMG SRC="/webapp/images/LOV.gif" BORDER=0 ALIGN=absmiddle></A>
</TD>
<TD><INPUT TYPE="hidden" NAME="vendor_id" SIZE="20" VALUE="<%= sa[16] %>"></TD>
</TR>
.
.
<TABLE>
<input type="Submit" NAME="save" value="SAVE">
</FORM>
</BODY>
</HTML>
======================================================================
called.jsp: the "vendor_id" is correctly passed and has been put into an object ("vendor_id"in the form. How to put "vendor_id" in a JSP statement so that its value can be passed to a JavaBean? The statement <% xvendor_id = request.getParameter("vendor_id" %> does not work since "vendor_id" didn't get here thru the POST method.
<HTML>
<HEAD>
<SCRIPT>
window.onload=fnInit;
function fnInit()
{
oVendorId.innerHTML=dialogArguments;
document.InvoiceForm.vendor_id.value = oVendorId.innerHTML;
}
</SCRIPT>
</HEAD>
<BODY>
<H4>Invoice List for Vendor Id <SPAN ID="oVendorId"></SPAN></H4>
<FORM NAME="InvoiceForm" METHOD="post" ACTION="WindowClose.jsp">
<TABLE>
<%! String xvendor_id; %>
<% xvendor_id = request.getParameter("vendor_id" %>
<% if (xvendor_id != null) { %>
<% util.connect(); %>
<% String[] [] invoice = select.getInvInfo(xvendor_id); %>
.
.
<% }%>
<TR><TD><SPAN><INPUT TYPE="hidden" NAME="vendor_id"></SPAN></TD></TR>
</TABLE>
</FORM>
</BODY>
</HTML>