pramodk-2
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Validate the image field (Repeating) in the Post Form in Toolset
1
2
Started by: pramodk-2
in: Toolset Professional Support
Problem: Solution: add_action('cred_form_validate', 'my_image_validation_func',10,2); function my_image_validation_func($error_fields, $form_data) { // all the valid file types $file_types = array('image/jpeg','image/png','image/jpg'); $max_size = 5 * 1024 * 1024; $forms = array( 1806 ); // Field data are field values and errors list($fields,$errors)=$error_fields; if (in_array($form_data['id'], $forms ) && (isset($_FILES['wpcf-book-images']['type']))) { // 1. Minimum number of photos is '3'. if ( count( $_FILES['wpcf-book-images']['name'] ) < 3 ) { $errors['wpcf-book-images'] = 'Add at least 3 images'; return array( $fields, $errors ); } // 2. Dimensions of the photo should be at least 350 (height) x 350 (width). foreach ( $_FILES['wpcf-book-images']['tmp_name'] as $tmp_image ) { $sizes = getimagesize( $tmp_image ); if ( $sizes[0] < 350 || $sizes[1] < 350 ) { $errors['wpcf-book-images'] = 'An image is too small. Images should be at least 350x350'; return array( $fields, $errors ); } } // 3. The file types should be JPG, PNG and JPEG. foreach ( $_FILES['wpcf-book-images']['type'] as $type ) { if ( !in_array( $type, $file_types ) ) { $errors['wpcf-book-images'] = 'Image file type is not supported: ' . $type; return array( $fields, $errors ); } } // 4. Maximum file size should be 5MB. foreach ( $_FILES['wpcf-book-images']['size'] as $size ) { if ( $size >= $max_size ) { $errors['wpcf-book-images'] = 'An Image is too big. Images should less than 5MB'; return array( $fields, $errors ); } } } //return result return array($fields,$errors); } Relevant Documentation: |
3 | 20 | 3 years, 7 months ago | ||
Cloudfare Bluehost – Anything settings needed for using Toolset
Started by: pramodk-2 in: Toolset Professional Support |
3 | 6 | 3 years, 7 months ago | ||
Minimum number of images in Toolset forms
Started by: pramodk-2 in: Toolset Professional Support |
2 | 8 | 3 years, 9 months ago | ||
Styling “Add new” button for images in the toolset forms
Started by: pramodk-2
in: Toolset Professional Support
Problem: The issue here is that the user wanted to style the add new button on their forms. Solution: This can be done by using the some css. Essentially the class that you will need to target with the css is the ".wpt-repadd" class. You can use this class and add your custom css to the css section of your form. Here is an example below of some css to change the font size of the button. .wpt-repadd{ font-size: 30px; } |
3 | 9 | 3 years, 9 months ago | ||
There seems to be an issue with the option "Show only filter options that would produce results"
Started by: pramodk-2 in: Toolset Professional Support |
2 | 7 | 3 years, 9 months ago | ||
Redirect to previous page after log-In using Toolset Log In forms
Started by: pramodk-2
in: Toolset Professional Support
Problem: The issue here is that the user wanted to redirect to the previous page after a successful login attempt. Solution: This is not something that is natively possible with Toolset and will need to be implemented with some amount of custom code. Perhaps you can try the code in the link below. |
2 | 3 | 3 years, 9 months ago | ||
Forms validation issues
1
2
Started by: pramodk-2
in: Toolset Professional Support
Problem: How to use "cred_form_validate" to validate custom field value when submit Toolset post form. Solution: Here is an example: https://toolset.com/forums/topic/forms-validation-issues/#post-1921395 Relevant Documentation: https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate |
3 | 16 | 3 years, 10 months ago | ||
Mandatory fields not allowing to submit even condition is false in toolset forms
1
2
Started by: pramodk-2
in: Toolset Professional Support
Problem: Add custom validation to post form using PHP codes. Solution: Here is an example: Relevant Documentation: https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate |
2 | 26 | 3 years, 10 months ago | ||
Validation of image field in the user form in toolset
1
2
Started by: pramodk-2 in: Toolset Professional Support |
2 | 28 | 3 years, 10 months ago | ||
Phone number field validation required in Toolset
Started by: pramodk-2 in: Toolset Professional Support |
2 | 5 | 3 years, 10 months ago | ||
Search results to show value 1 and 3 when 1 is selected in Toolset
Started by: pramodk-2 in: Toolset Professional Support |
2 | 7 | 3 years, 10 months ago | ||
Checkbox in checkboxes field mandatory for more than one field in a toolset form
Started by: pramodk-2 in: Toolset Professional Support |
2 | 13 | 3 years, 10 months ago | ||
Rename and style 'choose file' button in forms in Toolset
Started by: pramodk-2 in: Toolset Professional Support |
2 | 3 | 3 years, 11 months ago | ||
Conditional group based on the taxonomy input in the post form in toolset
Started by: pramodk-2 in: Toolset Professional Support |
2 | 5 | 3 years, 11 months ago |