小编weg*_*gie的帖子

Bootstrap Datepicker无法正常工作.

小提琴前:http://jsfiddle.net/EmwFE/

所以我一直试图让datepicker工作,我认为我按照指示,但我不能让日历弹出.

TIA

以下代码的小提琴示例.

                 <label class="control-label" for="input08"> 
                    My Start Date
                 </label>
                 <div class="controls">
                    <script type="text/javascript">
                        $(document).ready(function() {
                        $('.datepicker').datepicker();
                    </script>

                    <div class="input-append date" id="dp3" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
                        <input class="span2" size="16" type="text" value="12-02-2012" class="datepicker">
                        <span class="add-on"><i class="icon-th"></i></span>
                    </div>

                </div>
Run Code Online (Sandbox Code Playgroud)

css jquery twitter-bootstrap

6
推荐指数
2
解决办法
3万
查看次数

从下拉列表中为隐藏字段分配值

我有一个用 ajax 请求填写的表格。大部分进展顺利,但我似乎无法将下拉列表的值分配给隐藏变量。

这个想法是这样的:您选择一个先前完成的作业,该作业提交一个 ajax 请求,我将根据该请求填写表单的所有值。

您还可以选择删除(删除)此分配。为此,我需要获取 id 的值(它在 ajax 请求中返回)并将其填充到隐藏字段中。这个隐藏字段有不同的形式。当我尝试提交此表单时,该字段未填写。

示例代码:

function loadQuery() {
    var assign = $("#existingAssignment").val(); // Get the value of the select box so we can build the next page
    $.ajax({
        type: 'get',
        url: 'http://127.0.0.1/WMT/model/getCandidate.cfc',
        data: {
            method: 'getExistingAssignPosInfo',
            tourid: assign
        },
        dataType: 'json',
        async: false,
        success: function (result) {

            $('#removeAssignment').show(); // This is the name of the hidden field. We Show this when we get the JSON
            $('#removeAssignmentID').val(result.DATA[0][0]);

        }
    });
}
Run Code Online (Sandbox Code Playgroud)

超文本标记语言

<form class="form-horizontal" action=""> …
Run Code Online (Sandbox Code Playgroud)

html ajax jquery

0
推荐指数
1
解决办法
7357
查看次数

标签 统计

jquery ×2

ajax ×1

css ×1

html ×1

twitter-bootstrap ×1