1

I have a safecracker entry that I would like to change the status via jquery onClick or Submit? For example, I have one button that would be "save and preview" that onClick would change the status to "preview". There would be another button onClick button "Submit for Review" that would change the status of the same form to "pending". Is this possible?

1 Answer 1

1

You can do it easily with the Mefu

Just create a template having mefu tag OR just put this code within a template like tempgrp/tempname:

{exp:mefu:save}{/exp:mefu:save}

and put this JQuery code to post the entry status to above template:

$.post("temp_grp/temp_name", { "[entry_id]:staus": "Open", mefu: "submit" }, function(data){
alert('status updates')
} );

For the same purpose, you can write the UPDATE query to update the entry status.

For the preview, use the load() of JQuery like:

$.post("temp_grp/temp_name", { "[entry_id]:staus": "Open", mefu: "submit" }, function(data){
$('#container_id').load('preview_template');
} );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.