Support

Account

Home Forums ACF PRO ACF Front Edit Form – Disable specific field

Solved

ACF Front Edit Form – Disable specific field

  • Hello,

    I have created a “front form” and a “front edit form” usinf ACF pro.

    In my second form “front edit form” I want to disable specifics fields to avoid that the user changes specific informations (But I still want to display this fields).
    Here is my method

    /* Disable Fields */
    add_action( ‘acf/render_field/key=field_54dfc93e35ec4’, ‘tsm_disable_fields’, 10, 1 );

    /* Disable Fields */
    function tsm_disable_fields() {
    echo ‘disabled’;
    }

    Unfortunately it’s not working. Do you have aother solution ?

  • What about jQuery?, you can add the disabled attribute via selector.

  • Yes, thanks.

    jQuery(function( $ ){
    
    	$(document).ready(function() {
    		$( "#acf-field_54dfc93e35ec4" ).prop( "disabled", true );
    	});	
    });
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘ACF Front Edit Form – Disable specific field’ is closed to new replies.