1

I have a list named Parent. After I create and save an item I want to be redirected to the NewForm of that list (Parent) again, to create another item.

How can I do this?

2 Answers 2

1

You can make use of the Source query string parameter.

For the URL such as NewForm.aspx?Source=NewForm.aspx

3
  • Where should I put this link and how?
    – Iamnderon
    Commented Aug 29, 2016 at 12:46
  • One way is to add a Content Editor Webpart in add a hyper link.. Or you can use JavaScript to dynamically set this URL to the New Item link Commented Aug 29, 2016 at 12:47
  • Due I am new to SharePoint development can you tell me how javascript would like look or how to add that hyperlink in content editor?
    – Iamnderon
    Commented Aug 29, 2016 at 12:49
-1

Follow the below steps:

1) Download SharePoint Designer( same version as your sharepoint). 2) Download the Jquery file from internet and save it in Style library copy its path. 3) Open your site and navigate to NewForm.aspx of the Parent list. 4) You will see all XSLT and JS files mentioned there. 5) Refer your jquery inside contentplaceholder tag like this 6) Now open other script tag in next line

<script type=text/js> 
function PreSaveAction(){
$window.location= "(your Newform location)";
return true;
}

Happy coding!!

5
  • Instead of putting it in NewForm.aspx in Designer, Can I edit the default new form of my list and add a script editor there?
    – Iamnderon
    Commented Aug 29, 2016 at 13:01
  • 1
    I wouldn't use that code. It redirects to the new URL even if the validation of the item fails and is therefore never saved. Commented Aug 29, 2016 at 13:20
  • @DanielStölzner however the code it is not working for me in both ways
    – Iamnderon
    Commented Aug 29, 2016 at 13:25
  • if you need to check validation then there are many other stuffs which can be taken into account before submitting the form. I gave the code to navigate nothing more was asked.You can edit the Save button xslt in the designer and try to navigate to your desired page. Commented Aug 29, 2016 at 16:12
  • This will not work.
    – iOnline247
    Commented Aug 30, 2016 at 1:51

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.