Hi Minesh, thank you for the answer. Q1 is solved. I have deactivated all unnecessary plugins. Used a standard theme. And creating an account now works.
So now Q2. To make some fields required. I use the expert mode of the form editor. And then:
<div class="form-group">
<label for="%%FORM_ID%%_first_name">[cred_i18n name='first_name-label']First name *[/cred_i18n]</label>
[cred_field field='first_name' class='form-control' output='bootstrap' required='true']
</div>
Code found here: https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field
But if I leave the field empty, it still is submitted.
You can see it here: hidden link
Hello. Thank you for contacting the Toolset support.
Can you please share admin access details and let me review whats going wrong with your setup.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Hi Minesh, thank you for help.
With the code provided I can still make an account without filling First en Last name.
When I change $form_id = 0; to $form_id = 3803; (My USerform ID number) still the same.
And when I use this code:
add_filter('cred_filter_field_before_add_to_form', 'required_user_fields_func', 10, 2);
function required_user_fields_func($field, $computed_values){
if(in_array($field['id'], array('first_name', 'last_name'))){
$field['data'] = is_array($field['data']) ? $field['data'] : array();
$field['data']['validate']['required'] = array (
'active' => 1,
'value' => 1,
'message' => 'This field is required'
);
}
return $field;
}
It's the same.
With all 3 I can make an account without any required field filling.
Hi Minesh,
I added the code in the functions.php from my child theme. I have send you the credentials already, and the site is a copy of the live site. So feel free to check my setup.
Kind regards,
Corine