0

他の入力ボックスを備えた PHP フォームに実装したいこの jQuery 日付ピッカーが大好きです http://multidatespickr.sourceforge.net/

ユーザーが送信ボタンを押すと、別のページ update.php に移動し、そこでフォーム データが POST 経由で取得されます。

POST経由で複数の日付ピッカーの複数の日付の配列にアクセスできるように、javascriptに追加する行を探しています:

var latestMDPver = $.ui.multiDatesPicker.version;
        var lastMDPupdate = '2012-03-28';
  var dates = $('#simpliest-usage').multiDatesPicker('getDates');



            // Version //
            //$('title').append(' v' + latestMDPver);
            $('.mdp-version').text('v' + latestMDPver);
            $('#mdp-title').attr('title', 'last update: ' + lastMDPupdate);


            // Documentation //
            $('i:contains(type)').attr('title', '[Optional] accepted values are: "allowed" [default]; "disabled".');
            $('i:contains(format)').attr('title', '[Optional] accepted values are: "string" [default]; "object".');
            $('#how-to h4').each(function () {
                var a = $(this).closest('li').attr('id');
                $(this).wrap('<'+'a href="#'+a+'"></'+'a>');
            });
            $('#demos .demo').each(function () {
                var id = $(this).find('.box').attr('id') + '-demo';
                $(this).attr('id', id)
                    .find('h3').wrapInner('<'+'a href="#'+id+'"></'+'a>');
            });

            // Run Demos
            $('.demo .code').each(function() {
                eval($(this).attr('title','NEW: edit this code and test it!').text());
                this.contentEditable = true;
            }).focus(function() {
                if(!$(this).next().hasClass('test'))
                    $(this)
                        .after('<button class="test">test</button>')
                        .next('.test').click(function() {
                            $(this).closest('.demo').find('.box').removeClass('hasDatepicker').empty();
                            eval($(this).prev().text());
                            $(this).remove();
                        });
            });
        });
4

2 に答える 2

0

それがあなたが探しているものかどうかはわかりませんが、POST 経由でスクリプトに渡された日付にアクセスする必要がある場合は、次のようにします。

$dates = explode(',', $_POST['simpliest-usage']);
于 2013-05-29T17:19:52.813 に答える