I have a function which generates a new window with multiple hyperlinked values displayed. When the user selects a value, it is returned to the original form in a specified <INPUT> field.
I now need to have the page react to this new value; ie, if the user just types a value into the field instead of using the pop-up window, the form is submitted onChange and the panel redisplayed with the appropriate changes made based on the input value. This way I can have the page "dynamically" display the most recent data-set based on the input. So how would I go about following up the getVals function to implement the updtWin function?
entering <INPUT> value code (produces the desired result):
function updtWin(newVal) {
var URLstr4 = "REDISPLAY?cy=$(cy)&fldchgd=" + newVal.name
document.posnUpdt.action=URLstr4;
document.posnUpdt.submit();
}
<form method="post" name="posnUpdt">
...
<input type="text" name="DEPTID" size="10" maxlength="10"
onChange='updtWin(this)'>
...
</form>
pop-up window code (now what??):
function getVals() {
var argvals2 = getVals.arguments;
var URLstr2 = "QRYFRAMES?frmnm=" + argvals2[0] + "&tblnm=" + argvals2[1]
URLstr2 += "&fldnm=" + argvals2[2] + "&srchfld=" + argvals2[3]
var qfrm = window.open(URLstr2,'qryframes','width=450,height=490');
}
--> eventually returns value to argvals2[2] parameter in posnUpdt <--
<form method="post" name="posnUpdt">
...
<input type="BUTTON" VALUE="DeptIDs" HEIGHT="25" WIDTH="34"
onClick='javascript:getVals("posnUpdt","PS_DEPT_TBL","DEPTID","DeptID"'>
...
</form>
I now need to have the page react to this new value; ie, if the user just types a value into the field instead of using the pop-up window, the form is submitted onChange and the panel redisplayed with the appropriate changes made based on the input value. This way I can have the page "dynamically" display the most recent data-set based on the input. So how would I go about following up the getVals function to implement the updtWin function?
entering <INPUT> value code (produces the desired result):
function updtWin(newVal) {
var URLstr4 = "REDISPLAY?cy=$(cy)&fldchgd=" + newVal.name
document.posnUpdt.action=URLstr4;
document.posnUpdt.submit();
}
<form method="post" name="posnUpdt">
...
<input type="text" name="DEPTID" size="10" maxlength="10"
onChange='updtWin(this)'>
...
</form>
pop-up window code (now what??):
function getVals() {
var argvals2 = getVals.arguments;
var URLstr2 = "QRYFRAMES?frmnm=" + argvals2[0] + "&tblnm=" + argvals2[1]
URLstr2 += "&fldnm=" + argvals2[2] + "&srchfld=" + argvals2[3]
var qfrm = window.open(URLstr2,'qryframes','width=450,height=490');
}
--> eventually returns value to argvals2[2] parameter in posnUpdt <--
<form method="post" name="posnUpdt">
...
<input type="BUTTON" VALUE="DeptIDs" HEIGHT="25" WIDTH="34"
onClick='javascript:getVals("posnUpdt","PS_DEPT_TBL","DEPTID","DeptID"'>
...
</form>