0

Hi guys,

I have a question related to Epesi,I wanna make an action once the save button is clicked but I couldn't figure out how I would be able to manipulate the save button.Is there a way on how I could make a callback for the save button?
I am planning to redirect the page back to the previous page once the save button is clicked. I was thinking if I could do something like what the back button does only that,for the save, after saving process.

Thank you in advance.

2
Contributors
1
Reply
16
Views
2 Years
Discussion Span
Last Post by diafol
0

Haven't used epesi, but I assume that you need an ajaxed save routine? If using jQuery...

$('#savebutton').click(function(e)
{
    e.preventDefault();
    runSaveRoutine();
});

function runSaveRoutine()
{
    $.post('url',{sendData})
        .done(function(returnData)
        {
            if(returnData.someDataKey == 'someValue')
            {
                window.location.href = '...your new url here ...';
            }else{
                console.log(returnData.errors);
            }
        });
}

Edited by diafol

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.