I think the Save action supports an 'xredirect' parameter. So if your
form has a hidden input field with name='xredirect' then the user will
be redirected to the specified URL after the page is saved. So what
you can do is:

* catch the click event on the button
* ask for confirmation
https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm
* cancel/prevent the event if no, set the value of the 'xredirect'
parameter otherwise

Hope this helps,
Marius


On Mon, Oct 5, 2015 at 5:35 PM, Pascal BASTIEN <[email protected]> wrote:
> Hi,
>
> I have my application with MyClass, MySheet and MyTemplate.
> When I have a new page (based on MySheet/Class), in edit mode I can modify 
> all my fields of Myclass Object but I want to add a button to save my page 
> after confirmation...
>
> For the moment I have a button to redirect in a new page BUT I want to save 
> current page before redirect if the user agreed a confirmation box.
>
> More precisely on my nice appli, on new page in edit mode, I have standard 
> Save, Save and continue and cancel button and I want another one to ask on 
> clik: "are you sure to save current fields modified on current page and open 
> this another page"?
> - if yes save current page, add a value in a field with velocity and save and 
> redirect to another one.
> - if No stay in edit mode
>
> Do you have a way to recommend?
> (perhaps I must try  $('#form').submit(function() { with jquery)  but I don't 
> know if this save my page?
>
> Thxs for any help.
>
> Pascal B.
>
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to