SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
-
Sep 18, 2003, 20:18 #1
- Join Date
- Sep 2003
- Location
- Indonesia
- Posts
- 40
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Sep 18, 2003, 21:33 #2
-
Sep 24, 2003, 10:19 #3
- 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.
-
Sep 24, 2003, 10:26 #4
-
Sep 24, 2003, 11:01 #5
- 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.
VinnyWhere the World Once Stood
the blades of grass
cut me still
-
Sep 24, 2003, 14:37 #6
- 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';
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.
-
Sep 24, 2003, 18:08 #7
- 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.
-
Sep 25, 2003, 10:28 #8
- 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.
Bookmarks