Hide another field based on the selected date

add_action(‘frm_date_field_js’, ‘limit_my_date_field’); function limit_my_date_field($field_id){ $key_one = ‘FIELDKEY1‘; //Change FIELDKEY1 to the key of your date field $id_two = ‘FIELDID2‘; //Change FIELDID2 to the ID of your field to hide if($field_id == ‘field_’. $key_one){ echo ‘,onSelect:function(selectedDate,inst){ var theDate=new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay); var hideDate=new…Continue reading

Update the date when switching years

add_action(‘frm_date_field_js’, ‘update_date_value’); function update_date_value( $field_id ) { if ( $field_id == ‘field_FIELDKEY‘){ //change FIELDKEY to the key of your date field $date_format = ‘mm/dd/yy‘; // change this to the format of your date field ?> ,onChangeMonthYear: function (year, month, inst)…Continue reading

Display User ID dropdown on front-end for admin

add_filter(‘frm_setup_new_fields_vars’, ‘show_user_dropdown’, 15, 2); add_filter(‘frm_setup_edit_fields_vars’, ‘show_user_dropdown’, 15, 3); function show_user_dropdown($values, $field, $entry_id=false){ $action = FrmAppHelper::get_param( ‘action’, ”, ‘post’, ‘sanitize_text_field’ ); $creating_field = FrmAppHelper::doing_ajax() && ( $action === ‘frm_insert_field’ || $action === ‘frm_duplicate_field’ ); if ( $values[‘type’] == ‘user_id’ && !…Continue reading

Filter Dynamic Field

add_filter(‘frm_setup_new_fields_vars’, ‘filter_dfe_options’, 25, 2); function filter_dfe_options($values, $field){ if ( $field->id == 125 && !empty( $values[‘options’] ) ) {//Replace 125 with the ID of your Dynamic field $temp = $values; $temp[‘form_select’] = 30;//change 30 to the id of the field (in…Continue reading

Show admin all options in a filtered dynamic field

add_filter(‘frm_setup_new_fields_vars’, ‘do_not_restrict_admin’, 20, 2); function do_not_restrict_admin( $values, $field ) { if ( $values[‘restrict’] && current_user_can(‘administrator’) ) { if ( $values[‘type’] == ‘data’ && in_array( $values[‘data_type’], array( ‘select’, ‘radio’, ‘checkbox’ ) ) && is_numeric( $values[‘form_select’] ) ) { $values[‘restrict’] = 0;…Continue reading

Display two fields in a dynamic field

add_filter(‘frm_setup_new_fields_vars’, ‘customize_dfe’, 25, 2); function customize_dfe( $values, $field ) { if ( $field->id == 125 && !empty( $values[‘options’] ) ){//Replace 125 with the ID of your dynamic field $temp_values = $values; $temp_values[‘form_select’] = 30; //change 30 to the id of…Continue reading

Blackout specific dates

add_action(‘frm_date_field_js’, ‘limit_my_date_field’); function limit_my_date_field($field_id){ if ($field_id == ‘field_4k4w4j‘){ //change 4k4w4j to the key of your date field echo ‘,beforeShowDay: function (date){var d = date.getFullYear() + “-” + date.getMonth() + “-” + date.getDate();return [(d != “2014-8-28” && d != “2014-9-12” &&…Continue reading

Custom, dynamic date range

add_action(‘frm_date_field_js’, ‘limit_my_date_field’); function limit_my_date_field($field_id){ if($field_id == ‘field_FIELDKEY‘){ //change FIELDKEY to the key of your date field echo ‘,minDate:0,maxDate:+60‘; } }Continue reading

Use shortcode throughout HTML in form

add_filter( ‘frm_filter_final_form’, ‘filter_hide_this’ ); function filter_hide_this( $form ) { global $shortcode_tags; $original_shortcodes = $shortcode_tags; $limited_shortcodes = array( ‘hidethis’ => $shortcode_tags[‘hidethis’] ); $shortcode_tags = $limited_shortcodes; $form = do_shortcode( $form ); $shortcode_tags = $original_shortcodes; return $form; } add_filter( ‘frm_do_html_shortcodes’, ‘__return_false’ );Continue reading