Cross Site Lookup Add New Item
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hello,
You can retrieve any field value of the parent from the child via JavaScript if you open the child form in a dialog. The following code demonstrates how to get Title of the parent form:
You should put the code above into the child New form.
You can retrieve any field value of the parent from the child via JavaScript if you open the child form in a dialog. The following code demonstrates how to get Title of the parent form:
Code: Select all
window.top.fd.field('Title').value()
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
If you open the parent form in a dialog, please, try to put the following code into the child form:
Code: Select all
$('.ms-dlgFrame', window.top.document)[0]
.contentWindow.fd.field('Title').value()
In the this thread you showed me how to get the dialog form that opens another form so we can get data from the initial form onto the new form. This is working great. Now we are opening an initial form in dialog, then a child form in dialog then creating a new form in dialog, maybe several layer deep. I do understand how to get each of the dialog forms, what I need help with is how to get the last dialog form opened before the current new form.
Thank you.
Thank you.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
If you have multiple dialogs opened at the same time, you can retrieve their content by index:
Code: Select all
$('.ms-dlgFrame', window.top.document)[index]
.contentWindow.fd.field('Title').value()
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Getting the number of opened dialogs:
Loop over the list of dialogs:
Code: Select all
$('.ms-dlgFrame', window.top.document).length
Code: Select all
$('.ms-dlgFrame', window.top.document).each(function(i) {
// 'i' is an index
// 'this' is a document object
});
-
- Information
-
Who is online
Users browsing this forum: No registered users and 11 guests