|
Guest (Visitor) |
5 Mar 02 3:43 |
1st attempt ================================================================================ This is part of the the original code that calls the url that has all the names of the employees:
Gadget Window In my gadget.asp: the form name is Emp <form action="/fsn/fsn/manual.notify" name="Emp" >
If Search button is clicked and if the input box named i_emp_name is empty:
if (document.Emp.i_emp_name.value == '') { if (confirm("NOTE: Since you entered no search criteria, all employees will be returned. Are you sure?")) wnd=open("/fsn/fsn/w_misc.emp_list?i_emp_name=" + escape(document.Emp.i_emp_name.value ) + "%25" , "", "scrollbars=yes,resizable=yes,width=480,height=200,menubar=no"); }
This is the codes of url called with the lists of persons opened in another window:
<h1>Select Person</h1> <SCRIPT LANGUAGE='JAVASCRIPT'> function passBack(form) { opener.document.Emp.i_emp_name.value = form.i_emp_id.options[form.i_emp_id.selectedIndex].text; self.close(); }</SCRIPT> <form name="employeeListForm"> <SELECT NAME="i_emp_id" SIZE="1"> <OPTION value="000001"> --SELECT EMPLOYEE-- <OPTION value="000002">PAUL CHAVEZ <OPTION value="000003">MYRLA VARIAS </SELECT> <p><center><input type=button value="Select" onClick="javascript:passBack(employeeListForm)"> </center></form>
The name does not passback from another window to the gadget window. ================================================================================
2nd attempt ================================================================================ This is part of the the original code that calls the url that has all the names of the employees:
Gadget Window In my gadget.asp: the form name is Emp <form action="/fsn/fsn/manual.notify" name="Emp" >
If Search button is clicked and if the input box named i_emp_name is empty:
if (document.Emp.i_emp_name.value == '') { if (confirm("NOTE: Since you entered no search criteria, all employees will be returned. Are you sure?")) { window.open("search.asp" ,"searchwin","scrollbars=yes,resizable=yes,width=480,height=200,menubar=no"); }
Characters in red color are the only changed and it calls another search.asp which contains the same code as the url below. And it works but the disadvantage is that is doesn't call from names from the url but from the created file which has the same code as url but that this is not recommended even if it works.
<h1>EGN Select Person</h1> <SCRIPT LANGUAGE='JAVASCRIPT'> function passBack(form) { opener.document.Emp.i_emp_name.value = form.i_emp_id.options[form.i_emp_id.selectedIndex].text; self.close(); }</SCRIPT> <form name="employeeListForm"> <SELECT NAME="i_emp_id" SIZE="1"> <OPTION value="000001"> --SELECT EMPLOYEE-- <OPTION value="000002">PAUL CHAVEZ <OPTION value="000003">MYRLA VARIAS </SELECT> <p><center><input type=button value="Select" onClick="javascript:passBack(employeeListForm)"> </center></form>
What happened with this code is that, when the search button in the gadget was click it will display in another window the lists of employees and if I select one from the lists, this another window will close and pass the value selected to the main window.
Any Help? Thanks- |
|