• Thanks so much for this, works as promised. At the moment either attribute (disabled/readonly) works for me but I like having the option if needed.

    The only issue occurred when conditional logic was used, it killed the form – nothing displayed. Turns out jquery conflicts were to blame, after running the “jQuery Updater” plugin all is working perfectly.

    This really ought to be built into Gravity forms standard settings, thanks again.

Viewing 1 replies (of 1 total)
  • Thread Starter JayWhy

    (@jaywhy)

    Unfortunately this broke after upgrading Gravity Forms and others. I was getting “jquery is not defined” and had to change the plugin code.

    From this:

    add_action( 'wp_enqueue_scripts', 'disable_gf_fields' );
    function disable_gf_fields() {
    	wp_enqueue_script( 'disable-gf-fields', plugins_url( '/disable-gf-fields.js', __FILE__ ) );
    }

    To this:

    add_action( 'wp_enqueue_scripts', 'disable_gf_fields' );
    function disable_gf_fields() {
    	wp_enqueue_script( 'disable-gf-fields', plugins_url( '/disable-gf-fields.js', __FILE__ ), array('jquery'));
    }

    Note: the addition of “, array(‘jquery’)”.

    I also modified the js file to disable datepicker fields by adding this:
    $(".gform_wrapper .readonly .ginput_container input").datepicker().datepicker('disable');

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘As Promised’ is closed to new replies.