0

joomla モジュールを作成し、カレンダー フォーム フィールドを追加しました。

<field name="date" type="calendar" default="2010-01-30" format="%Y-%m-%d" label="Enter date" description="" class="date_field" />

ユーザーがカレンダーアイコンを使用して日付を入力している間はすべて正常に機能しますが、ユーザーが他の情報を書き込むと、モジュール設定を保存した後、すべてがクラッシュします。

私の考えは、入力フィールドを読み取り専用にすることですが、readonly="true" を使用すると、カレンダー アイコンが消えます。

4

2 に答える 2

1
jQuery(document).ready(function(){
    jQuery(document).on('keydown', '#jform_scheduled_time', function(event) {
       return false;
    });
});

Try this and user will not able to write anything in calendar box and for opening calendar pop up on click anywhere do this-

jQuery(document).on('focusin', '#jform_scheduled_time', function(event) {
           event.preventDefault();
           jQuery(this).parent().siblings(':eq(0)').show();
    });
于 2018-08-16T10:39:09.527 に答える