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

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

Add javascript to your form

add_action(‘frm_entries_footer_scripts’, ‘set_custom_limit’, 20, 2); function set_custom_limit($fields, $form){ if($form->id != 5) return; //change 5 to the ID of your form ?> //add javascript here <?php }Continue reading

Limit the number of characters

add_action(‘frm_entries_footer_scripts’, ‘set_custom_limit’, 20, 2); function set_custom_limit($fields, $form){ if($form->id != 5) return; //change 5 to the ID of your form ?> jQuery(document).ready(function($){ $(‘#field_FIELDKEYHERE’).change(function(){ if($(this).val().length > 15) $(this).val($(this).val().substr(0, 15)); }); }); <?php }Continue reading

Set the Formidable stylesheet

add_filter(‘get_frm_stylesheet’, ‘my_custom_stylesheet’, 30, 2); function my_custom_stylesheet($previous_css, $location=’header’){ global $frm_vars; if ( ! isset($frm_vars[‘css_loaded’]) || ! $frm_vars[‘css_loaded’] ) { $css_file[‘formidable’] = admin_url(‘admin-ajax.php’) . ‘?action=frmpro_css’; } return $css_file; }Continue reading

Show ten rows

add_filter( ‘frm_repeat_start_rows’, ‘frm_set_ten_rows’, 10, 2); function frm_set_ten_rows( $row_num, $field ){ if ( $field[‘id’] == 508 ) { $row_num = 10; } return $row_num; }Continue reading