For a textarea I want to give the user two options for saving.
- save the document and continue editing.
- save and exit
No I know how to save and continue with a AJAX call. And of course save and exit is easy. The combination of the two is confusing me. I tried some Googling but without any luck. Can someone point me in the right direction?
Thanks!
Edit... My code:
<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
<form action="post" action="save.cfm" name="formname" id="formname">
<textarea name="text"></textarea>
<input type="submit" value="save and exit">
<input type="submit" value="save and continue">
</form>
<script>
$(function () {
$('#formname').on('submit', function (e) {
$.ajax({
type: 'post',
url: '/wall/save_and_continue.cfm',
data: $('form').serialize(),
success: function () {
alert('form was submitted');
}
});
e.preventDefault();
});
});
</script>