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

Change the blank option label in Dynamic field

add_filter(‘frm_setup_new_fields_vars’, ‘change_dynamic_blank_option’, 25, 2); function change_dynamic_blank_option($values, $field){ if ( in_array( $field->id, array( 100,101,102 ) ) ) {//Replace 100, 101, and 102 with the IDs of your Dynamic fields if ( empty( $values[‘options’] ) ) { return $values; } $values[‘options’][”] =…Continue reading

Order field options

add_filter(‘frm_setup_new_fields_vars’, ‘frm_reorder_options’, 30, 2); function frm_reorder_options($values, $field){ if ( $field->id == 125 ) {//Replace 125 with the ID of your field asort($values[‘options’]); // sort the values here } return $values; }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