Hey guys. I have the following questions regarding the following script below. Within the script (towards the bottom) you will see the precise sections I am concerned with commented. Please see the section respective to each questions below:
1.) I have a javescript dynamic calendar pop-up window which opens when the users clicks the image. As you can see the NAME property for the INPUT form item is assigned according to the iterations of the recordset. The pop-up window is programmed to replace the value of the INPUT field for the table row that was selected. Currenty, the pop-up window has a javascript fuction which sets the VALUE of the INPUT Item that has the name "First" how can I make this dynamic so that it replaces the values of only the selected cell??
2.) I need to have an Oracle stored procedure that needs to run when the user clicks the submit button. The stored procedure will need to take as parameteres all of the original values of the record from the recordset, as well as the values that have been changed. How do I set up the parameter list for the Stored Procedure call to handle this?
<%@page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*"%>
<% Driver DriverRateQuery = (Driver)Class.forName("ora
cle.jdbc.d
river.Orac
leDriver")
.newInstan
ce();
Connection ConnRateQuery = DriverManager.getConnectio
n("jjdbc:o
racle:thin
:@127.0.0.
1:1521:myD
ataBase","
scott","ti
ger");
PreparedStatement StatementRateRec = ConnRateQuery.prepareState
ment("SELE
CT ACTIVE_IND,
TO_CHAR(FIRST_DATE,'MM/DD/
YYYY') FIRST_DATE,
INTL_RATE INTL_RATE,
TO_CHAR(LAST_DATE,'DD/MM/Y
YYY') LAST_DATE,
LAST_UPD_DATE,
MARKET,
RATE_TYPE,
TERMINAL_ID,
MARKET_NAME,
ACTIVE_IND
FROM myRateTable,
myMarkets
WHERE myRateTable.MARKET = myMarkets.MARKET );
ResultSet RateRec = StatementRateRec.executeQu
ery();
boolean RateRec_isEmpty = !RateRec.next();
boolean RateRec_hasData = !RateRec_isEmpty;
Object RateRec_data;
int RateRec_numRows = 0;
PreparedStatement StatementRateType = ConnRateQuery.prepareState
ment("SELE
CT DISTINCT
rate_type,
DECODE(rate_type,'CPS','Ca
ps','BP','
BluePrints
') rate_label
FROM myRateTable");
ResultSet RateType = StatementRateType.executeQ
uery();
boolean RateType_isEmpty = !RateType.next();
boolean RateType_hasData = !RateType_isEmpty;
Object RateType_data;
int RateType_numRows = 0;
%>
<HTML>
<FORM name="Record" action="">
<TABLE>
<% if (!RateRec_isEmpty ) { %>
<% while ((rateRecord_hasData)&&(Re
peat1__num
Rows-- != 0)) { %>
<tr valign="middle">
<td height="27">
<input name="terminalID"
type="text"
id="terminalID"
value="<%=((((RateRec_data
= RateRec.getObject("TERMINA
L_ID"))==n
ull || RateRec.wasNull())?"":Rate
Rec_data))
%>"
size="10"
readonly>
</td>
<td height="27">
<input value="<%=((((RateRec_data
= RateRec.getObject("INTL_RA
TE"))==nul
l || RateRec.wasNull())?"":Rate
Rec_data))
%>" type="text" name="BillingRate">
</td>
<td height="27">
<select name="RateType" size="1">
<% while (RateType_hasData) { %>
<option value="<%=((RateType.getOb
ject("RATE
_TYPE")!=n
ull)?RateT
ype.getObj
ect("RATE_
TYPE"):"")
%>"
<%=(((RateType.getObject("
RATE_TYPE"
)).toStrin
g().equals
(((((RateR
ec_data = RateRec.getObject("RATE_TY
PE"))==nul
l
|| RateRec.wasNull())?"":Rate
Rec_data))
.toString(
)))?"SELEC
TED":"")
%>
>
<%=((RateType.getObject("R
ATE_LABEL"
)!=null)?R
ateType.ge
tObject("R
ATE_LABEL"
):"")%>
</option>
<% RateType_hasData = RateType.next(); }
RateType.close();
RateType = StatementRateType.executeQ
uery();
RateType_hasData = RateType.next();
RateType_isEmpty = !RateType_hasData;
%>
</select>
</td>
<td height="27">
<%
<input id=First
readOnly
maxlength=10
size=10
value=<%=((((RateRec_data = RateRec.getObject("FIRST_D
ATE"))==nu
ll || RateRec.wasNull())?"":Rate
Rec_data))
%>
name=First
>
<img id=IMG1 src="images/calendar.gif"
onClick="javascript:popUp(
'
http://localhost/StartCalender.htm')"
width=24
border="0"
align="absmiddle"
>
</td>
//------------------------
QUESTION PART 1 --------------------------
--------//
<td height="27">
<input id=First
readOnly
maxlength=10
size=10
value=<%=((((RateRec_data = RateRec.getObject("LAST_DA
TE"))==nul
l || RateRec.wasNull())?"":Rate
Rec_data))
%>
name=<%String("First") + (String)Repeat1__index%>
>
<img id=IMG1 src="images/AllPages/calen
dar.gif"
onClick="javascript:popUp(
'
http://localhost/EndCalender.htm')"
width=24
border="0"
align="absmiddle"
>
//------------------------
QUESTION PART 2 --------------------------
--------//
</td>
<td width="158" height="27" bordercolor="#FFFFFF">
<input name="updRate"
type="button"
id="updRate"
value="Update Rate">
</td>
</tr>
<% Repeat1__index++; rateRecord_hasData = rateRecord.next(); } %>
</TABLE>
</FORM>
</HTML>
<% rateRec.close(); rateType.close(); ConnRateQueryord.close(); %>