if there are two shortcodes – EMEFS doesn’t work (no datepicker)
-
The shortcode “[emefs_submit_event_form]” is used twice on the site.
The first shortcode is called via the button in modal windows, and the second one is specified on the page. In this case, the shortcode on the page doesn’t work – no datepicker. if you disable the shortcode plugin by clicking the button, the shortcode on the page works correctly – datepicker is present on the page.Forms or fields may have the same name that js uses to define the form.
Requires you to make different names, for example, like this (_num++):function my_shortcode_liveclockserver_func ( $attr, $content = null ) { static $form_num; $form_num++; .... <form name='lcs_$form_num'> <input type='text' class='polein' name='lcs2_$form_num'> .... document.lcs_$form_num.lcs2_$form_num.value='0'; ....
Code of plugin (button)
<?php /* * Plugin Name: мой шорткод кнопки добавления события * Description: [my_shortcode_add_event_btn] */ add_shortcode ( 'my_shortcode_add_event_btn', 'my_shortcode_add_event_btn_func' ); function my_shortcode_add_event_btn_func ( $attr, $content = null ) { echo ' <a href="#add-even" class="button-ev button-ev-pink">Добавить событие</a> <div id="add-even" class="modalBackground-ev"> <div class="modalWindow-ev"> <h4>Добавим событие в календарь?</h4> <p>'; echo do_shortcode('[emefs_submit_event_form]'); echo '</p> <p><a href="#close" class="but-close-win-ev" title="Закрыть окно без сохранения">Отмена ввода события</a></p> </div> </div> <style> .modalBackground-ev { position: fixed; top: 0; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.5); z-index: 60; opacity: 0; pointer-events: none; } </style> '; } ?>
Help me make several options for calling the add events form work
Look the screenshotThe page I need help with: [log in to see the link]
- The topic ‘if there are two shortcodes – EMEFS doesn’t work (no datepicker)’ is closed to new replies.