Create a confirmation field

add_filter(‘frm_validate_field_entry’, ‘your_custom_validation’, 20, 3); function your_custom_validation($errors, $field, $value){ if ($field->id == 31){ //change 31 to the ID of the confirmation field (second field) $first_value = $_POST[‘item_meta’][30]; //change 30 to the ID of the first field       if ( $first_value…Continue reading

Combine multiple fields into one field

add_filter(‘frm_validate_field_entry’, ‘my_custom_validation’, 8, 3); function my_custom_validation( $errors, $posted_field, $posted_value ) { if($posted_field->id == 25){ //change 25 to the ID of the destination field //change the value between the quotes to what should go in-between values $separator = “, “; $_POST[‘item_meta’][25]…Continue reading

Limit uploaded file size

add_filter( ‘frm_validate_field_entry’, ‘validate_custom_file_size’, 20, 3 ); function validate_custom_file_size( $errors, $field, $value ) { if ( $field->type == ‘file’ && ( isset( $_FILES[‘file’.$field->id] ) ) && ! empty( $_FILES[‘file’.$field->id][‘name’] ) ) { $files = (array) $_FILES[‘file’. $field->id][‘size’]; foreach ( $files as…Continue reading

Limit number of uploaded files

add_filter(‘frm_validate_field_entry’, ‘validate_number_of_files’, 10, 3); function validate_number_of_files($errors, $field, $value){ if ( in_array($field->id, array(25,26,27)) && $field->type == ‘file’ && (isset($_FILES[‘file’.$field->id])) && !empty($_FILES[‘file’.$field->id][‘name’])){ $files = (array)$_FILES[‘file’. $field->id][‘name’]; $count = 0; foreach($files as $n){ if(!empty($n)) $count++; } $existing = $_POST[‘item_meta’][$field->id]; if($existing){ foreach($existing as $e){…Continue reading

Limit the number of times a date can be selected

add_filter(‘frm_validate_field_entry’, ‘my_custom_validation’, 10, 3); function my_custom_validation($errors, $posted_field, $posted_value){ if($posted_field->id == 125 and !is_admin()){ //change 125 to the ID of the date field $frmpro_settings = FrmProAppHelper::get_settings(); $selected_date = FrmProAppHelper::convert_date($posted_value, $frmpro_settings->date_format, ‘Y-m-d’); //get all the entries for that date $entries_for_date = FrmEntryMeta::get_entry_metas_for_field(125,…Continue reading

Limit responses for a set time period

add_filter(‘frm_validate_field_entry’, ‘my_custom_validation’, 10, 3); function my_custom_validation($errors, $posted_field, $posted_value){ if($posted_field->id == 25 and !is_admin()){ //change 25 to thema ID of the field to validate global $wpdb; $entry_id = (isset($_POST[‘id’])) ? $_POST[‘id’] : 0; $entries = $wpdb->get_col($wpdb->prepare(“SELECT item_id FROM ” . $wpdb->prefix…Continue reading

Change to like

add_filter( ‘frm_set_comparison_type_for_lookup’, ‘customize_lookup_value_retrieval’, 10, 3); function customize_lookup_value_retrieval( $type, $parent_field, $child_field ) { if ( $parent_field->id == 123 ) { $type = ‘like’; } return $type; }Continue reading

Customize a Dynamic List field

add_filter(‘frm_show_it’, ‘custom_dynamic_list_display’, 10, 3); function custom_dynamic_list_display( $html, $value, $args ) { if ( $args[‘field’]->id == 30 ) { //change 30 to the id of the linked field ID // Customize displayed value here } return $html; }Continue reading

Show full image instead of thumbnail

add_filter( ‘frm_show_it’, ‘custom_frm_show_it’, 10, 3 ); function custom_frm_show_it( $html, $value, $args ) { if ( $args[‘field’]->id == 30 ) { //change 30 to the id of the upload field in the other form $media_ids = explode( ‘, ‘, $args[‘value’] );…Continue reading

Show option label

add_filter(‘frm_show_it’, ‘dynamic_list_show_option_label’, 10, 3); function dynamic_list_show_option_label( $html, $value, $args ){ if ( $args[‘field’]->id == 485 && $args[‘field’]->field_options[‘separate_value’] ) { foreach ( $args[‘field’]->options as $option ) { if ( is_array( $option ) && isset( $option[‘value’] ) && $option[‘value’] == $value )…Continue reading