Hide a field when editing

add_filter(‘frm_field_type’, ‘change_my_field_type’, 10, 2); function change_my_field_type($type, $field){ if(in_array($field->id, array(125, 126))){ //change 125 and 126 to the ids of the fields to hide global $frm_vars; if((!is_admin() || defined(‘DOING_AJAX’)) && isset($frm_vars[‘editing_entry’]) && $frm_vars[‘editing_entry’]) { //if not in admin area and editing an…Continue reading

Hide a field when not editing

add_filter(‘frm_field_type’, ‘change_my_field_type’, 10, 2); function change_my_field_type($type, $field){ if(in_array($field->id, array(125, 126))){ //change 125 and 126 to the ids of the fields to hide global $frm_vars; if((!is_admin() || defined(‘DOING_AJAX’)) && (!isset($frm_vars[‘editing_entry’]) || !$frm_vars[‘editing_entry’])) { //if not in admin area and not editing…Continue reading

Remove option used variable times

add_filter(‘frm_setup_new_fields_vars’, ‘frm_remove_selected’, 20, 2); function frm_remove_selected($values, $field) { $quantity_field = ‘frm-inquantity‘; // change to the field key for the quantity field in the other form $signup_field = ‘frm-signup-item‘; // change to the field key of the dynamic field that should…Continue reading

Remove option after n submissions

add_filter(‘frm_setup_new_fields_vars’, ‘frm_remove_full_option’, 20, 2); function frm_remove_full_option($values, $field){ if ( in_array( $field->id, array( 426, 427, 428 ) ) ) { $submitted_values = FrmEntryMeta::get_entry_metas_for_field( $field->id ); if ( $submitted_values ) { // Break out multi-dimensional array for checkbox field values if (…Continue reading

Remove an option

add_filter(‘frm_setup_new_fields_vars’, ‘remove_field_option’, 30, 2); add_filter(‘frm_setup_edit_fields_vars’, ‘remove_field_option’, 30, 2); function remove_field_option( $values, $field ) { if ( $field->id == 25 ) { // change 25 to your field id $options_to_remove = array( ‘12:00 PM‘, ‘12:30 PM‘ ); foreach ( $options_to_remove as…Continue reading

Change Date Format

add_filter(‘frm_datepicker_formats’, ‘add_custom_frm_format’); function add_custom_frm_format($formats) { $formats[‘j M, Y‘] = ‘d M, yy‘; //change PHP and Datepicker formats return $formats; }Continue reading

Show all fields on the final page of a multi-paged form

add_filter(‘frm_get_paged_fields’, ‘get_extra_form_fields’, 30, 3); function get_extra_form_fields($fields, $form_id, $error=false){ if($form_id == 25){ //change 25 to the id of the form to change $prev_page = FrmAppHelper::get_param(‘frm_page_order_’. $form_id, false); if($prev_page > 3){ //change 3 to a number higher than the order of second…Continue reading

Remove page breaks from the admin

add_filter( ‘frm_get_paged_fields’, ‘remove_my_breaks’, 9, 2 ); function remove_my_breaks( $fields, $form_id ) { if ( ! is_admin() ) { return $fields; } if ( $form_id == 12 ) { // change 12 to the ID of your form remove_filter( ‘frm_get_paged_fields’, ‘FrmProFieldsHelper::get_form_fields’,…Continue reading

Dynamically populate checkbox field

add_filter(‘frm_setup_new_fields_vars’, ‘frm_set_checked’, 20, 2); function frm_set_checked($values, $field){ if($field->id == 125){//Replace with the ID of your field $values[‘value’] = array($_GET[‘color1‘], $_GET[‘color2‘]); //Replace color1 and color2 with the names of your parameters in the URL } return $values; }Continue reading

Replace field options

add_filter(‘frm_setup_new_fields_vars’, ‘frm_set_checked’, 20, 2); function frm_set_checked($values, $field){ if($field->id == 125){//Replace 125 with the ID of your field $values[‘options’] = array(‘Option 1‘, ‘Option 2‘); //Replace Option1 and Option2 with the options you want in the field } return $values; }Continue reading