Jquery UI 日期选择器不起作用


Jquery Ui Date Picker Not Working?

我的表单代码在这里。

<div class="threeleft second" id='displayallformshow' style="float: none;width: 80%;padding:10px;">
    <form action="investor_submit.php">
        <div class='formdiv'>
            <div style='width:35%;margin-top:12px;'>Published :</div>
            <div style='width:41%;text-align:justify'>
                <div style="float: left;">
                    <input type="radio" name="published" id="" value='publishedyes'>
                </div>
                <div style="float: left;width: 237px;">Yes, allow users who follow links to my venture URL the ability to see my venture page.</div>
                <br>
                <br>
                <div style="float: left;">
                    <input type="radio" name="published" id="" value='publishedno'>
                </div>
                <div style='float: left;width: 237px;'>No, display an error message to anybody who tries to follow links to my venture except for me.</div>
            </div>
        </div>
        <br>
        <br>
        <div class='formdiv'>
            <div style='width:35%;margin-top:12px;'>Listed and Discoverable :</div>
            <div style='width:41%;text-align:justify'>
                <div style='float: left;'>
                    <input type="radio" name="listedanddiscoverable" id="" value='listedanddiscoverableyes'>
                </div>
                <div style='float: left;width: 237px;'>Yes, I want my ventureto be listed in the browser section making it discoverable to RockThePost Visitors. (Required Paid Subscription)</div>
                <br>
                <br>
                <div style='float: left;'>
                    <input type="radio" name="listedanddiscoverable" id="" value='listedanddiscoverableno'>
                </div>
                <div style='float: left;width: 237px;'>No, do not list my venture anywhere automatically. I willmanually invite people to my venture with my venture URL.</div>
            </div>
        </div>
        <div class='formdiv'>
            <div style='width:35%;margin-top:12px;'>Describe Start Date :</div>
            <div style='width:55%;'>
                <input class='madetextboxlong' placeholder="Enter Describe Start Date" type="text" name="describestartdate" id="describestartdate">
            </div>
        </div>
        <div class='formdiv'>
            <div style='width:35%;margin-top:12px;'>Describe end Date :</div>
            <div style='width:55%;'>
                <input class='madetextboxlong' placeholder="Enter Describe end Date" type="text" name="describeenddate" id="describeenddate">
            </div>
        </div>
        <br>
        <br>
        <br>
        <div style="margin-left: 288px;margin-top: 423px;width: 100%;" class="formdiv">
            <input type="submit" id='publishform' class="madebtnsave" name="save" value="Save" />
        </div>
    </form>
</div>

我在点击事件时加载的表单。 用户在加载时单击投资者选项卡。

该表单工作正常,但问题在于未加载 jquery UI 日期选择器

这是我的日期选择器代码。

$( "#describestartdate" ).datepicker();
$( "#describeenddate" ).datepicker();

请帮助我解决这个问题,如何工作jquery日期选择器。

当我加载没有单击事件的表单时,日期选择器成功显示。

但是我加载表单以单击日期选择器未显示的事件。

亲爱的朋友试试这个。

$("event tab ID").click(function(){
     $( "#displayallformshow #describestartdate" ).datepicker();
    $( "#displayallformshow #describeenddate" ).datepicker();
});

我希望这完全适合您。

如果在单击事件上加载表单,则必须注册datepicker处理程序

$( "#describestartdate" ).datepicker();
$( "#describeenddate" ).datepicker();

加载后。将这些行放在表单加载回调(单击事件)的末尾。否则,这些行将在目标项可用之前执行,即 $("#describestartdate")将返回一个空列表,并且没有任何反应。