Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

How to passback a value from another page to the other?

Guest (Visitor) (OP)
5 Mar 02 1:54
I am trying to passback the value from the other window to the other but I can't
from the url. I copied the code from that url i am trying to password and
created my own file and passback the value from that file and it works! Why? I
need to use the given url so that If there is an update on the lists, mine will
be updated too. If I used the created file, and if there's an additional lists,
the created file will not be updated and so i need to manually update that file.
Please help! Thanks in Advance!

What Im trying to do here is:
I have an input box and if I click search button, it will open another window containing the lists of names to find and a passback
function to return whatever name i selected from that window to the parent window using the url provided. Note: They have the
same form name but it doesn't functioning.
But if I copy all the codes from the other window that opens after clicking the search button, and created my own file in the
same folder, it is working but the thing is this file will not be updated as the one with the url. what if in the url they add new names
on the lists, tendency is that i have to manually look at the code from the url and add the names added to my file created so
that will be from time to time i have to check the new names added from the url. How is that? Any Help? thanks in advance!
spewn (Programmer)
5 Mar 02 2:03
post your code to further illustrate your intentions...

- spewn
Guest (Visitor) (OP)
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-
Guest (Visitor) (OP)
5 Mar 02 20:18
Any HElp?
Guest (Visitor) (OP)
6 Mar 02 21:02
I have no response from then on! why?
Guest (Visitor) (OP)
16 Apr 02 1:04
how can i close the parent window from the chlid window.
NEVERSLEEP (Programmer)
16 Apr 02 4:47
use framesets
name frames
target=name

someone knowledge ends were
someone else knowledge starts

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close