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.

Member Avatar for diafol

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);
            }
        });
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.