CRED plugin allows you to build front-end forms for creating and editing content. These forms can include all the fields that belong to the content and display them with your HTML styling. CRED forms also support input validation and automatic email notifications.
When you ask for help or report issues, make sure to tell us the structure and the settings of your form.
Viewing 15 topics - 1,936 through 1,950 (of 1,959 total)
add_filter('cred_success_redirect', 'custom_redirect_form_abc',10,3);
function custom_redirect_form_abc($url, $post_id, $form_data)
{
if ($form_data['id']==12345){
if (isset($_POST['form_submit_2'])) {
$url = "https://yoursite.com/alternate-redirect/";
}
}
return $url;
}
Note that the "form_submit_2" key may need to be modified in your site. Log or dump the $_POST superglobal to find the appropriate key when you submit using the second submit button. You must also set the Form to redirect to some existing post or page in wp-admin, or the redirect override code will not work.
Problem:
A Toolset Form includes repeating fields where the user can add additional instances of the field. Client wants to limit how many instances of the field can be added, in such a way that the same technique (with different limits) can be used on multiple fields.
Solution:
A simple solution is to use a little custom JavaScript which hides the "Add New" button once the relevant number of instances has been added.
To be able to target different fields with different limits, add a class to the div wrapping the form field, something like this, where the class 'limit-to-3' is added: