Support

Account

Home Forums Feature Requests Ignore required fields only if post status is Draft Reply To: Ignore required fields only if post status is Draft

  • Now i solved editing the function click_ignore like that

    click_ignore: function( e ) {
    	if(jQuery('#post_status').val()=='pending'){
    		this.$trigger = e.$el;
    	} else {
    		// reference
    		var self = this;
    		
    		
    		// vars
    		this.ignore = 1;
    		this.$trigger = e.$el;
    		this.$form = e.$el.closest('form');
    		
    		
    		// remove error message
    		$('.'+this.message_class).each(function(){
    			acf.remove_el( $(this) );
    		});
    		
    		
    		// ignore required inputs
    		this.ignore_required_inputs();
    		
    		
    		// maybe show errors
    		setTimeout(function(){
    			self.ignore = 0;
    		}, 100);
    	}
    	
    }