Link to home
Start Free TrialLog in
Avatar of chaitu chaitu
chaitu chaituFlag for India

asked on

displaying employee data in parent window from child window erasing previous data


in the parent jsp i have Multiple Employes button and Show Employees buton;when user clicks Show Employees buton it fetches all employees data from DB and displayed in the below section;that is working fine;if user clicks Multiple Employes button it opens pop window there user can enter specific employee numbers and should be displayed in the parent window wiping out the previous data.in the pop window if user enter invalid employee numbers then  in the popup window itself we should display errors.if user enters correct data then employee details should be displayed in the parent window wiping out the previous data.

i am getting problem while displaying data in parent window when user enter employee no in child window.i am also getting probelm if user enter invalid employee numbers then   we should display errors in the popup window itself;

parent jsp
**********
<html>
    <head>
            <script>
            function popup()
            {
                        var myUrl = 'child.jsp';
                        newWin = window.open(myUrl);
            }



</script>
</head>
<BODY >
<FORM  method="post" action="">

<TABLE width=800 border="1" cellspacing="0" cellpadding="0" bordercolor="#b3b3d9">
  <TBODY>
  <TR bgColor=#ffffff>
    <TD >
   
            <TABLE width="800">
              <TR class="formdata">
          <TD  align=right >
             
                  <INPUT class="input" name='Multiple'  type="button" value='Multiple Employes' onClick = "popup();">
            
              <INPUT class="input" name='button'  type=submit value='Show Employees'>
              </TD>
            </TR>
             
        </TABLE>
        </TBODY>
      <table border="0" width="800" cellpadding="2" cellspacing="1" >
          <tr class='formdata'>
            <td>&nbsp;</td>
          </tr>
        </table>
            <table border="0" width="800" cellpadding="2" cellspacing="1" >
            <tr class='formheader' align=center>
            
                  <td> </td>
            
                  <td >Employee Number</td>
                  <td>EmployeeOrigin</td>
                  <td>EmployeeDest</td>
                  <td  width = "74">Employee Code </td>
            
                  </tr>
            
<tr class='formdata' >

<td><input type="checkbox" id="empCheck0" name="empCheck" ></td>

                  <td>KHY696
                  </td>

                  <td></td>
                  <td>DGDG</td>
                  <td>DGDG</td>
                  <td></td>
                  <td></td>
                  <td></td>
                  
            </tr>
           
<tr class='formdata' >

<td><input type="checkbox" id="empCheck1" name="empCheck"></td>

                  <td>KHY697
                  </td>
                  <td></td>
                  <td>FHFH</td>
                  <td>FHFH</td>
                  <td>KG</td>
                  
            </tr>
           

         </FORM>

   
    </body>
</html>






child.jsp
*********
 
<html>
<head>
<script>
function sendData()
{

      Url = "main.jsp";
      document.forms[0].action = Url;
      document.form1.submit();

}
 

 

</SCRIPT>
</head>
<BODY>
<form name="form1" method="post" action="" >

      <table width="800" border="1" cellspacing="0" cellpadding="0" bordercolor="#b3b3d9">
      <tr>
            <td class=formheader>
                  <table width="800" border="0" cellspacing="1" cellpadding="2">
                  <tr>
                        <td class=formlabel colspan="2">Enter Multiple Employees  for deletion</td>
                  </tr>
                  </table>
                  <table  class='formlabel' border="0" cellspacing="0" cellpadding="0" width=100%>
                  <tr>
                        <td class=formdata colspan="2">
                              <font color="red" size="2"><b>

                              </b></font>
                        </td>
                  </tr>
              </table>
                  
                  <table width="800" border="0" cellspacing="1" cellpadding="2">
                  <tr>
                  <td class=formheader align=center>Emp No<input type="text" name="empno1" value=""></td></tr>
                  <tr><td class=formheader align=center>Emp No<input type="text" name="empno2" value=""></td></tr>

                  </table>
                  <table width="800" border="0" cellspacing="1" cellpadding="2">
                        <tr class=formdata>
                        <td class=formdata align = 'right'><input type="button" value="ENTER" name="ENTER"  class='input' id="ENTER" onClick="sendData();"></td>
                        
                        </tr>
                  </table>
  </table>
</form>
</body>
</html>
Avatar of deeppra
deeppra

send me where u have the problem
Avatar of chaitu chaitu

ASKER

i am not able to hide the parent data when i entered employee number in child window.
// open a document called 'thisdoc.html'
// in a window named 'win02'
window.open('thisdoc.html', 'win02');

//to close the window
win02.close();

ASKER CERTIFIED SOLUTION
Avatar of deeppra
deeppra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial