I created a custom webpart which has an iframe inside of it. In this iframe I load the questions of a survey list. I did already using jQuery to style that page. I inject with jQuery some css in the page which is loaded in the iframe. In the survey question page there is a submit button. Is it possible to override this button? I would like to submit and finish it with a redirection to another page.
1 Answer
You can use PreSaveAction()
function to write your custom code before submitting the form.
You can do a return false
to stop page from loading or else just do a Jquery redirect.
-
But I would like to do the submit first and then a redirect to some page. Is that possible?– OlaCommented Jun 5, 2015 at 14:25
-
Suppose you click submit button in page A and it gets you to page B. Add a js file to page B and write the redirect code like
ExecuteOrDelayUntilScriptLoaded(init,'sp.js'); function init(){ window.location.replace("http://stackoverflow.com"); }
– KeerthiCommented Jun 5, 2015 at 14:28