Toolset Forms misses support for password protection post status.
You'd have to apply Custom Code to update the Password chosen by the user during submission of the Form.
WordPress manages password-protected posts like so:
1. It creates a normal post entry in the database
2. That Post entry gets a column post_password, which holds the password chosen, not encrypted or anything (which is lucky for us who write custom code for it)
3. The post status is still "publish", even if the WP Backend will say "password protected".
This means in Toolset Forms, all we'd need is an input field (can be a generic field) and a checkbox (which also can be generic) that lets the user set "yes, please password protect my post" and then set a password.
We will grab that value, and update it to the post, using cred_save_data() hook.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
Using that hook we can get data from the form when it's submitted and when it saves things in the database we can interact there and update the entry.
We are not allowed to write a fully working custom code, but the below example is well commented and should help you achieve the goal tailored to your case.
Note that your form needs 2 fields, a Checkbox "checkbox_yes_protect_my_post" and a single line "post_password_custom" or similarly named.
Note that you could hide the post_password_custom line field - using a Forms Conditional - until the checkbox is checked.
That's, however, a minor design detail, here the code that will do the magic (please keep in mind that you need to understand, and then adapt this code to your specific use case)
add_action('cred_save_data', 'my_save_data_action',10,2);
function my_save_data_action($post_id, $form_data)
{
// Change the ID below to the ID of your Toolset Form
if ($form_data['id']==12) {
//if our checkbox field checkbox_yes_protect_my_post is checked
if ($_POST['checkbox_yes_protect_my_post'] == 1) {
//Get the value from post_password_custom field
$password = $_POST['post_password_custom'];
//update the post with the new password
//we can use Update, because at this point forms already created the post
//$post_id is the Post we create with Forms, it is given to us by the Forms API, see functions parameters
$my_post = array(
'ID' => $post_id,
'post_password' => $password
);
// Insert the post into the database
wp_update_post( $my_post );
}
}
}