Support

Account

Home Forums Backend Issues (wp-admin) Please enter no more than 0 characters.

Solved

Please enter no more than 0 characters.

  • My client suddenly emailed me that every time she tries to save (update) an existing page that has ACF fields on it she gets multiple errors on simple text fields “Please enter no more than 0 characters.”. This is extremely bizarre because nothing has changed. I have tried manually setting a character limit as well as making the fields not required but I still get the messages. No errors in the JS console. Any ideas??! Thank you!

    Running ACF PRO 5.6.1 on WP 4.8.1

    Here’s a screenshot of the errors:
    http://imgur.com/a/IzOsE

    And the field group export code:

    if( function_exists('acf_add_local_field_group') ):
    
    acf_add_local_field_group(array (
    	'key' => 'group_589cdd7ef3eab',
    	'title' => 'Event Additional',
    	'fields' => array (
    		array (
    			'key' => 'field_58b5d9fc7a825',
    			'label' => 'Additional Info',
    			'name' => 'additional_info',
    			'type' => 'flexible_content',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'layouts' => array (
    				'58b5da0e73e55' => array (
    					'key' => '58b5da0e73e55',
    					'name' => 'schedule',
    					'label' => 'Schedule',
    					'display' => 'block',
    					'sub_fields' => array (
    						array (
    							'key' => 'field_58b5e9b8f35bc',
    							'label' => 'Title',
    							'name' => 'title',
    							'type' => 'text',
    							'instructions' => '',
    							'required' => 1,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'default_value' => 'Schedule',
    							'placeholder' => '',
    							'prepend' => '',
    							'append' => '',
    							'maxlength' => 50,
    						),
    						array (
    							'key' => 'field_58b5da1d7a826',
    							'label' => 'Day',
    							'name' => 'schedule_day',
    							'type' => 'repeater',
    							'instructions' => '',
    							'required' => 1,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'collapsed' => '',
    							'min' => 0,
    							'max' => 0,
    							'layout' => 'block',
    							'button_label' => 'Add Day',
    							'sub_fields' => array (
    								array (
    									'key' => 'field_58b89b99758f0',
    									'label' => 'Title',
    									'name' => 'title_day',
    									'type' => 'text',
    									'instructions' => '',
    									'required' => 1,
    									'conditional_logic' => 0,
    									'wrapper' => array (
    										'width' => '',
    										'class' => '',
    										'id' => '',
    									),
    									'default_value' => '',
    									'placeholder' => 'e.g. "Day 1"',
    									'prepend' => '',
    									'append' => '',
    									'maxlength' => '',
    								),
    								array (
    									'key' => 'field_58b5da447a827',
    									'label' => 'Date',
    									'name' => 'date',
    									'type' => 'date_picker',
    									'instructions' => '',
    									'required' => 1,
    									'conditional_logic' => 0,
    									'wrapper' => array (
    										'width' => '',
    										'class' => '',
    										'id' => '',
    									),
    									'display_format' => 'F j, Y',
    									'return_format' => 'Ymd',
    									'first_day' => 1,
    								),
    								array (
    									'key' => 'field_58b5da4f7a828',
    									'label' => 'Item',
    									'name' => 'item',
    									'type' => 'repeater',
    									'instructions' => '',
    									'required' => 1,
    									'conditional_logic' => 0,
    									'wrapper' => array (
    										'width' => '',
    										'class' => '',
    										'id' => '',
    									),
    									'collapsed' => '',
    									'min' => 1,
    									'max' => 0,
    									'layout' => 'table',
    									'button_label' => 'Add Item',
    									'sub_fields' => array (
    										array (
    											'key' => 'field_58b5da5f7a829',
    											'label' => 'Start Time',
    											'name' => 'start_time',
    											'type' => 'time_picker',
    											'instructions' => '',
    											'required' => 1,
    											'conditional_logic' => 0,
    											'wrapper' => array (
    												'width' => '',
    												'class' => '',
    												'id' => '',
    											),
    											'display_format' => 'g:i a',
    											'return_format' => 'g:i a',
    										),
    										array (
    											'key' => 'field_58b5da7a7a82a',
    											'label' => 'End Time',
    											'name' => 'end_time',
    											'type' => 'time_picker',
    											'instructions' => '',
    											'required' => 1,
    											'conditional_logic' => 0,
    											'wrapper' => array (
    												'width' => '',
    												'class' => '',
    												'id' => '',
    											),
    											'display_format' => 'g:i a',
    											'return_format' => 'g:i a',
    										),
    										array (
    											'key' => 'field_58b5da837a82b',
    											'label' => 'Item Title',
    											'name' => 'item_title',
    											'type' => 'text',
    											'instructions' => '',
    											'required' => 1,
    											'conditional_logic' => 0,
    											'wrapper' => array (
    												'width' => '',
    												'class' => '',
    												'id' => '',
    											),
    											'default_value' => '',
    											'maxlength' => '',
    											'placeholder' => '',
    											'prepend' => '',
    											'append' => '',
    										),
    										array (
    											'key' => 'field_58b5da8f7a82c',
    											'label' => 'Speaker (optional)',
    											'name' => 'speaker',
    											'type' => 'text',
    											'instructions' => '',
    											'required' => 0,
    											'conditional_logic' => 0,
    											'wrapper' => array (
    												'width' => '',
    												'class' => '',
    												'id' => '',
    											),
    											'default_value' => '',
    											'maxlength' => '',
    											'placeholder' => '',
    											'prepend' => '',
    											'append' => '',
    										),
    									),
    								),
    							),
    						),
    					),
    					'min' => '0',
    					'max' => '1',
    				),
    				'58b632d8edeb9' => array (
    					'key' => '58b632d8edeb9',
    					'name' => 'video',
    					'label' => 'Video',
    					'display' => 'block',
    					'sub_fields' => array (
    						array (
    							'key' => 'field_58b632efedebb',
    							'label' => 'Title',
    							'name' => 'title',
    							'type' => 'text',
    							'instructions' => '',
    							'required' => 1,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'default_value' => '',
    							'placeholder' => '',
    							'prepend' => '',
    							'append' => '',
    							'maxlength' => '',
    						),
    						array (
    							'key' => 'field_58b632deedeba',
    							'label' => 'Video',
    							'name' => 'video',
    							'type' => 'oembed',
    							'instructions' => '',
    							'required' => 1,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'width' => '',
    							'height' => '',
    						),
    					),
    					'min' => '',
    					'max' => '',
    				),
    				'58b63313171f9' => array (
    					'key' => '58b63313171f9',
    					'name' => 'text',
    					'label' => 'Text',
    					'display' => 'block',
    					'sub_fields' => array (
    						array (
    							'key' => 'field_58b63313171fa',
    							'label' => 'Title',
    							'name' => 'title',
    							'type' => 'text',
    							'instructions' => '',
    							'required' => 1,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'default_value' => '',
    							'placeholder' => '',
    							'prepend' => '',
    							'append' => '',
    							'maxlength' => '',
    						),
    						array (
    							'key' => 'field_58b63313171fb',
    							'label' => 'Text',
    							'name' => 'text',
    							'type' => 'wysiwyg',
    							'instructions' => '',
    							'required' => 1,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'default_value' => '',
    							'tabs' => 'all',
    							'toolbar' => 'full',
    							'media_upload' => 1,
    							'delay' => 1,
    						),
    					),
    					'min' => '',
    					'max' => '',
    				),
    			),
    			'button_label' => 'Add Block',
    			'min' => '',
    			'max' => '',
    		),
    	),
    	'location' => array (
    		array (
    			array (
    				'param' => 'post_type',
    				'operator' => '==',
    				'value' => 'tc_events',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'normal',
    	'style' => 'default',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => '',
    	'active' => 1,
    	'description' => '',
    ));
    
    endif;
  • Bizarrely, i have figured out that if the fields are “toggled” closed the save looks like it works i.e. the page re-loads but none of the changes are actually saved. I’m wondering if this is just some kind of JS issue but not sure how to debug as no errors are thrown!

    I’ve emailed support but no word back yet…

  • I looked at this when you first posted, but I could not find anything. All my testing came up empty.

    Not sure what you mean by “toggled” closed. If you mean hidden by conditional logic then this is the correct behavior. If you mean that the field groups is collapsed, then this would be incorrect behavior.

    But I cannot reproduce this. My first assumption would be a conflict with another plugin or something in the theme. Was anything updated recently?

  • Thanks for the reply, your suggestion got me digging and found a plugin (Tickera) that was running jQuery.validate() on the ACF fields and because they have a ‘maxlength’ property that is unspecified this was being treated as a maxlength of 0, causing the error. I will talk with that developer about ignoring the ACF fields.

    Thanks for your help!

  • Thanks mooner, that was my problem. A different and unknown plugin (I will try and get to the bottom of it later), but the immediate solution was to put a maxlength attribute which did the job!

    cheers

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Please enter no more than 0 characters.’ is closed to new replies.