runcsmeduncs
Programmer
I have a form that launches a popup when the user clicks on an anchor link.
The html for the popup looks like this:
<html>
<head>
<script language="JavaScript" type="text/javascript">
function passBack(x)
{
opener.document.frmdept_submit.p_dept.value= x;
opener.document.frmdept_submit.p_dept.focus();
close();
}
</script>
</head>
<body>
<TABLE >
<TR>
<TD> DEPT </TD>
<TD> DESC </TD>
</TR>
<TR>
<TD> <A HREF="javascript
assBack('1258');">1258</A> </TD>
<TD> <A HREF="javascript
assBack('1258');">IT Department</A> </TD>
</TR>
<TR>
<TD> <A HREF="javascript
assBack('5897');">5897</A> </TD>
<TD> <A HREF="javascript
assBack('5897');">HR Department</A> </TD>
</TR>
</TABLE>
</body>
</html>
As you can see there is a JS function called passBack which accepts 1 input variable (x). Basically all this function does whn called in the body of the html document, is to set the value of the input box "p_dept" to the value specified and set focus to that input box.
This works fine when the form hsa only one row in it as there is only one input box called "p_dept".
When there are more than 1 row (and there may be many) there are multiple existances of "p_year" and the passBack function does not know which box to return the value to.
Could someone please provide me some help in how I can get the passBack function to work when I have more than 1 row in my form (frmdept_submit).
Thanks in advance
The html for the popup looks like this:
<html>
<head>
<script language="JavaScript" type="text/javascript">
function passBack(x)
{
opener.document.frmdept_submit.p_dept.value= x;
opener.document.frmdept_submit.p_dept.focus();
close();
}
</script>
</head>
<body>
<TABLE >
<TR>
<TD> DEPT </TD>
<TD> DESC </TD>
</TR>
<TR>
<TD> <A HREF="javascript
<TD> <A HREF="javascript
</TR>
<TR>
<TD> <A HREF="javascript
<TD> <A HREF="javascript
</TR>
</TABLE>
</body>
</html>
As you can see there is a JS function called passBack which accepts 1 input variable (x). Basically all this function does whn called in the body of the html document, is to set the value of the input box "p_dept" to the value specified and set focus to that input box.
This works fine when the form hsa only one row in it as there is only one input box called "p_dept".
When there are more than 1 row (and there may be many) there are multiple existances of "p_year" and the passBack function does not know which box to return the value to.
Could someone please provide me some help in how I can get the passBack function to work when I have more than 1 row in my form (frmdept_submit).
Thanks in advance