• Resolved grebos

    (@grebos)


    Currently I am setting up the [event_form] page and I want the “no-location needet” Checkbox to be checked by default. I think, this is feasible by setting the default value of location_id of a new event to 0. How can this be done?

    grebos

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    you can try to use jquery/javascript to checked it by default;

    eg. https://www.electrictoolbox.com/check-uncheck-checkbox-jquery/

    Thread Starter grebos

    (@grebos)

    Thanks, I implemented it like that:

    jQuery(document).ready(function($){
    	<?php if (empty($EM_Event->event_name)) {
    		echo "var isNewEvent = true;";
    	}
    	else {
    		echo "var isNewEvent = false;";
    	}
    	?>
    	if(isNewEvent){
    		$("#no-location").prop("checked", true);
    	}
    }

    I assumed, that it is only a new event, if there is no title. Probably not the best way but it works, and it leaves the everithing as it is when one manipulates an event after its creation

    Thanks for sharing your code; I’m sure that will help someone else.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Change new Event default values’ is closed to new replies.