我的表单代码在这里。
<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 datepicker
这是我的日期选择代码。
$( "#describestartdate" ).datepicker();
$( "#describeenddate" ).datepicker();
请帮我解决问题如何使用jquery datepicker。
当我在没有点击事件的情况下加载表单时,datepicker会成功显示。
但我将表单加载到datepicker未显示的click事件。
答案 0 :(得分:2)
$("event tab ID").click(function(){
$( "#displayallformshow #describestartdate" ).datepicker();
$( "#displayallformshow #describeenddate" ).datepicker();
});
我希望这完全适合你。
答案 1 :(得分:1)
如果您在点击活动中加载表单,则必须注册datepicker
处理程序
$( "#describestartdate" ).datepicker();
$( "#describeenddate" ).datepicker();
加载后。将这些行放在表单加载回调(点击事件)的末尾。否则,这些行将在目标项可用之前执行,即$("#describestartdate")
将返回一个空列表并且没有任何反应。