如何在mvc中的bootbox.prompt中添加多个字段

时间:2017-03-17 07:58:08

标签: asp.net-mvc fullcalendar bootbox

我想在fullcalendar中点击特定日期时添加项目名称和任务名称,但我不知道如何使用bootbox.prompt或bootbox.dialog与多个字段,所以你能帮我解决吗? ?

SELECT distinct ?p 
WHERE 
{ ?url1 rdf:type <http://dbpedia.org/ontology/Town> . 
?url2 rdf:type <http://dbpedia.org/ontology/District> . 
?url1 ?p ?url2 .}

1 个答案:

答案 0 :(得分:1)

很简单,我们可以使用bootbox对话框

bootbox.dialog({
                    title: 'Add New Event',
                    message:  $('#form'),
                    show: false,
                }).on("shown.bs.modal", function (e) {
                    $('#form').show()

                }).on('hide.bs.modal', function (e) {
                    /**
                     * Bootbox will remove the modal (including the body which contains the login form)
                     * after hiding the modal
                     * Therefor, we need to backup the form
                     */
                    $('#form').hide().appendTo('body');
                })
        .modal('show');
                calendar.fullCalendar('unselect');
            }

在html中

<form id="form" method="post" class="form-horizontal" style="display: none;">
<div class="form-group">
    <label class="col-xs-3 control-label">Username</label>
    <div class="col-xs-5">
        <input type="text" class="form-control" name="username" />
    </div>
</div>

<div class="form-group">
    <label class="col-xs-3 control-label">Password</label>
    <div class="col-xs-5">
        <input type="password" class="form-control" name="password" />
    </div>
</div>

<div class="form-group">
    <div class="col-xs-5 col-xs-offset-3">
        <button type="submit" class="btn btn-primary" style="float:right;">Login</button>
    </div>
</div>