Buttons to save data

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 7, 2013   (RSS)

By gversion - December 30, 2012

Hi,

I am trying to create a "cancel", "save and continue editing" and "save and exit" button on a custom front-end user control panel I am designing for CMS Builder.

I have used the following code and it works but it's not very elegant:

                    <a href="javascript:void(0)" class="button button-red"><span onclick="window.location.href='./dashboard.php';">CANCEL</span></a>
                    <a href="javascript:void(0)" class="button button-green"><span onclick="document.getElementById('hid').value='save';document.getElementById('hid2').value='exit';form1.submit();">SAVE &amp; EXIT</span></a>
                    <a href="javascript:void(0)" class="button button-green"><span onclick="document.getElementById('hid').value='save';document.getElementById('hid2').value='stay';form1.submit();">SAVE & CONTINUE EDITING</span></a>

The problem is that when the user clicks the "save and continue editing" button, the page reloads, displays the old data and then reloads again to display the newly saved data.

Ideally when the button is clicked the page will just reload the once and display the new data.

I would be grateful if anyone could help me improve this.

Thank you,

Greg

By gversion - January 7, 2013

Hi Jason,

Thanks for getting back to me on this. A friend of mine seems to have resolved this for me but I am not sure what he did...

I will update the post if I can find out so that others can benefit.

Regards,

Greg