0

I am currently using REST API to get list items and display them on HTML via a Content Editor Web Part. We have the list hidden and do not wish to allow users access to it.

On there we have the following code to display a button if no item exists for the current user:

if(data.d.results.length == 0){
$('#person').append('<div class="btn" id="addNew" onclick="javascript:OpenPopUpPage(&#39;/../Lists/MySampleList/NewForm.aspx&#39;);">New Item</div>');

}

I am looking for a way to refresh the home page when the form is submitted. Currently when no item exists the button displays and when the form is submitted it still displays the button to NewForm.aspx.

I want the page to reload and display the item contents with another button to the EditForm.aspx

  • 1
    One way could be to use window.location = ... instead of opening the NewForm in a popup and attach the Source parameter to the url (which is used as the redirect page after submitting the form) – Steve T Mar 14 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.