0

I have written the following code to load a popup(List B NewForm.aspx) when a List A NewForm.aspx is submitted. The popup has a div.

var dialogOptions = SP.UI.$create_DialogOptions();
dialogOptions.url = "someURL";
dialogOptions.width = 750;
dialogOptions.height = 500; 
dialogOptions.dialogReturnValueCallback = Function.createDelegate( null, CloseCallback); 
SP.UI.ModalDialog.showModalDialog(dialogOptions);

In the List B NewForm.aspx, I have added script to access the div. But by following code part div cannot be accessed. Any suggestions please.

document.getElementById("divID");
4
  • 1
    you are trying to access div in which page List A NewForm.aspx or List B NewForm.aspx ?? Commented Nov 19, 2019 at 14:27
  • document.getElementById("divID") is added in List B NewForm.aspx Commented Nov 19, 2019 at 14:51
  • 1
    divID is in List A NewForm.aspx or List B NewForm.aspx ?? Commented Nov 19, 2019 at 15:03
  • It's also in List B NewForm.aspx Commented Nov 19, 2019 at 16:09

1 Answer 1

0

Please try the following:

  1. Check whether you have added all necessary js references in your List B NewForm.aspx

  2. On page load of List B NewForm.aspx, add an alert('Page loaded'), and see whether this loads, if this works, then you might be referencing a wrong div or div which is not available in List B NewForm.aspx.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.