Tell us what you are trying to do?
I have a problem with this website. I have added some code weeks ago and it works fine, but since some days it doesn't work anymore.
I have also deactivated all plugins except of Toolset Types, but it still doesn't work. Just when I deactivate my "a-zuchtschau.js" it works, but of course not with my changings...
The problem is:
When I change the date, type or ort (=place) everything is fine, but when I click on save it breaks and the new values won't be saved.
In the console of the browser I don't find any issues and also not in the debug.log
Can you help me to find the problem?
Best Regards
Andreas
Here is the code:
it is enqueued by
"add_action('admin_enqueue_scripts', 'a_admin_enqueue');
function a_admin_enqueue() {
$screen = get_current_screen();
if ( 'post' === $screen->base && 'zuchtschau' === $screen->post_type )
{
wp_enqueue_script('ats_script', get_stylesheet_directory_uri() . '/a-zuchtschau.js','jquery');
}
}
"
and
a-zuchtschau.js contains just the following lines
jQuery(document).ready(function()
{
jQuery("#title").prop('disabled', true);
jQuery("input[name=\"wpcf[pruefung-gesamtergebnis]\"]").prop('disabled', true);
function aktualisiereTitel() {
var ereignisTyp=jQuery("input[name=\"wpcf[pruefung-typ]\"]:checked").val();
var ereignisOrt=jQuery("input[name=\"wpcf[pruefung-ort]\"]").val();
var ereignisDatum=jQuery("input[name=\"wpcf[pruefung-datum][display-only]\"]").val();
var datum = new Date(ereignisDatum);
var tag=datum.getDate();
var monat=datum.getMonth()+1;
if (tag<10)
{
tag="0"+tag;
}
if (monat<10)
{
monat="0"+monat;
}
var jahr=datum.getFullYear();
var ereignisTitel=ereignisTyp + " am " + tag + "." + monat + "." + jahr + " in " + ereignisOrt;
jQuery("#title").prop('disabled', false);
jQuery("#title").val(ereignisTitel);
jQuery("#title-prompt-text").text("");
jQuery("#title").prop('disabled', true);
}
jQuery("input[name=\"wpcf[pruefung-typ]\"]").change(function() {
aktualisiereTitel();
});
jQuery("input[name=\"wpcf[pruefung-datum][display-only]\"]").datepicker({ onSelect: function() {
aktualisiereTitel();
}});
jQuery("input[name=\"wpcf[pruefung-ort]\"]").change(function() {
aktualisiereTitel();
});
});