普通网友 2014-12-03 09:41
浏览 43

将jquery完整日历提示输入框更改为下拉列表

I am implementing jquery full calendar in my PHP website. when i am clicking on any date of calendar it is giving me a prompt. There is a input field asking for event title. I want to change this input field and want a drop down list in place of input field. Is it possible? This is the calendar that i am using http://fullcalendar.io/

<script>

    $(document).ready(function() {

        $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            defaultDate: '<?php echo date("Y-m-d"); ?>',
            selectable: true,
            selectHelper: true,
            select: function(start, end) {
                var title = prompt('Please fill schedule title & add fees');
                var eventData;
                if (title) {
                    eventData = {
                    title: title,
                    url: 'javascript:fee_add("' + title + '","' + start +'");',
                    start: start,
                    end: end
                    };
                    $('#calendar').fullCalendar('renderEvent', eventData, true); // stick? = true
                }
                $('#calendar').fullCalendar('unselect');
            },
            editable: true,
            eventLimit: true, // allow "more" link when too many events
            events: [
                <?php
                     if($mysql->rowCount($query) > 0)
                    {
                        $rows = $mysql->fetchArray($query);
                        foreach($rows as $row)
                        {
                            if($row['date_time'] !='0000-00-00 00:00:00')  
                            {
                                $date1 = date_create_from_format('Y-m-d H:i:s', $row['date_time']);
                                $date = date('Y-m-d', $date1->getTimestamp());
                                $time = date('H:i', $date1->getTimestamp());
                                $time_hr = date('H:i:s', $date1->getTimestamp());
                            }
                ?>
                            {
                                title: '<?php echo $row["fee_title"]; ?>',
                                url: 'javascript:fee_edit(<?php echo $row["id"]; ?>,"<?php echo $row["fee_title"]; ?>","<?php echo $date . " " . $time_hr; ?>");',
                                start: '<?php echo $date; ?>T<?php echo $time ?>'
                            },
                <?php
                        }
                    }
                ?>
            ]
        });

    });
        </script>



</div>

<div id='calendar'></div>

This is the code i am implementing and just want dropdown list in place of title

Thanx in advance

  • 写回答

1条回答 默认 最新

  • dsds661730652211 2014-12-04 02:29
    关注

    Prompt is a built is js component. You shouldn't attempt to override it. Try using a custom dialog/modal. jQuery UI has a great dialog component that would allow you to utilize a select element or any other html you see fit.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看