SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    Indonesia
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Passing value from Parrent Window to Popup window????

    Hi, I really get mad when i try to passing values form parrent window to popup window. Let me say that I Have an ASP page and i Need to pass a Value from parent window to popup that need to received by popup/child window.
    Ex. (not complete script)
    function Training(Colid,Name,Region,Department)
    {
    -> At this point I don't know how to pass the value for all that variable to new popup window

    document.frmpersonnel.value=Colid
    document.frmpersonnel.value=Name
    document.frmpersonnel.value=Region
    document.frmpersonnel.value=Department

    }

    I wish someone can help me.....thx a lot

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First thing to do is to read this thread

    http://www.sitepointforums.com/showt...hreadid=129059

    Let me know after that.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    Indonesia
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm... I've looked the code you gave, but i think that not what i expect, maybe this time i'll give the more complete Code

    on the main page i have this code on my JScript

    function Work_Experience(COLID,Code,Name,JobTitle,Department,Region,Unit,DateJoined)
    {
    document.frmQuery.SelectedCOLID.value = COLID
    document.frmQuery.EmployeeCode.value = Code
    document.frmQuery.EmployeeName.value = Name
    document.frmQuery.EmployeeJobTitle.value = JobTitle
    document.frmQuery.EmployeeDepartment.value = Department
    document.frmQuery.EmployeeRegion.value = Region
    document.frmQuery.EmployeeUnit.value = Unit
    document.frmQuery.EmployeeDateJoined.value = DateJoined
    document.frmQuery.action = "./work_experience_list.asp"
    document.frmQuery.submit()
    }
    Link to Open Work_experience Page (With Image Link)
    <A href="javascript:Work_Experience('<%=oObj.COLID%>','<% = oObj.EmployeeCode%>','<% = oObj.EmployeeName%>','<% = oObj.JobTitleCode%>','<% = oObj.DepartmentCode%>','<% = oObj.RegionCode%>','<% = oObj.Unit%>','<% = oObj.DateJoined%>')" >

    Then on the popup window that i expected,i put this code

    (child window)
    (Request Value - Asp code)
    <% RequestedCode = Request.Form("EmployeeCode")
    RequestedName = Request.Form("EmployeeName")
    RequestedJobTitle = Request.Form("EmployeeJobTitle")
    RequestedDepartment = Request.Form("EmployeeDepartment")
    RequestedRegion = Request.Form("EmployeeRegion")
    RequestedUnit= Request.Form("EmployeeUnit")
    RequestedDateJoined = Request.Form("EmployeeDateJoined")
    RequestedPage = Request.Form ("RequestedPage")
    %>
    On The Form I Have Hidden type to recieve the value from main page:

    <input type = "hidden" name = "EmployeeCode" value = "<% = RequestedCode%>">
    <input type = "hidden" name = "EmployeeName" value = "<% = RequestedName%>">
    <input type = "hidden" name = "EmployeeJobTitle" value = "<% = RequestedJobTitle%>">
    <input type = "hidden" name = "EmployeeDepartment" value = "<% = RequestedDepartment%>">
    <input type = "hidden" name = "EmployeeRegion" value = "<% = RequestedRegion%>">
    <input type = "hidden" name = "EmployeeUnit" value = "<% = RequestedUnit%>">
    <input type = "hidden" name = "EmployeeDateJoined" value = "<% = RequestedDateJoined%>">

    This code is working properly whithout popup, i mean when i pass the values to another page(not Popup window), but They not work with Popup window......
    I Hope You can help me.....thxx A lot.

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, correct me if I'm wrong, but it looks like you're using a form to generate your query-string, yes?
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  5. #5
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Maybe I'm misunderstanding this, but...
    If you are creating the popUp client-side, you cannot ask it to understand once-removed asp. The browser doesn't interpret the popUp's code until the window is created. At that time, there is no server, only client.

    You need to send the data to the popUp as javascript, not asp.

    (child window)
    var RequestedCode = opener.document.frmQuery.EmployeeCode.value
    or
    var RequestedCode = opener.Code // if 'Code' is global
    or
    use the location.string code Beetle posted in the link.

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  6. #6
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I didn't really read it all, but a simple method would be:

    Code:
    var newWindow = window.open([...]);
    newWindow.variable = 'something';
    Behold, that variable is now available in the new window.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  7. #7
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    Indonesia
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi Beetle .Yes i use Form to generate the querystring, but exactly I build the web use .dll Component with Stored Procedure to execute the connection to database, that's why i just put the value once on the main page(call Personal Record of Employee) then the Main Page must give some value to another page.
    I think I Should give you the complete code, if i should...
    And Vincent,Yes I curious too that the new window not load anything from server, only client side.I'll try your Suggestion. thx Anyway.

  8. #8
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    Indonesia
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this time i try to give the complete Code
    I give the attachment,thx.
    Attached Files Attached Files


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •