最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Jquery Ui Date Picker Not Working? - Stack Overflow

programmeradmin4浏览0评论

My form code is here.

<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>

that form i load on click event. user click on investor tab when load.

that form is working properly but the problem is not loading the jquery ui datepicker

this is my datepicker code.

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

Please help me to solve that problem how to working jquery datepicker.

when i load form without click event the datepicker is display successfully.

but i load form to click event the datepicker is not showing.

My form code is here.

<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>

that form i load on click event. user click on investor tab when load.

that form is working properly but the problem is not loading the jquery ui datepicker

this is my datepicker code.

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

Please help me to solve that problem how to working jquery datepicker.

when i load form without click event the datepicker is display successfully.

but i load form to click event the datepicker is not showing.

Share Improve this question edited Oct 21, 2013 at 8:40 Alex Tape 2,3014 gold badges26 silver badges37 bronze badges asked Oct 21, 2013 at 7:33 user2050308user2050308 4
  • 1 working demo jsfiddle/98vRd ; Yo, make sure you have reference Jquery UI refernce correctly, hope demo will throw some light! :) – Tats_innit Commented Oct 21, 2013 at 7:36
  • any errors on the console? – Soundz Commented Oct 21, 2013 at 7:36
  • 1 not show any error in console. – user2050308 Commented Oct 21, 2013 at 7:37
  • 1 @Tats_innit you are write datepicker is load but my form is display on click event when user click on button then display form so that i load form onclick event then datepicker is not show. – user2050308 Commented Oct 21, 2013 at 7:38
Add a ment  | 

2 Answers 2

Reset to default 2

dear friend try this.

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

i hope this is used full for you.

If you load your form on a click event, you have to register the datepicker handlers

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

after having loaded it. Put these line to the end of the form-loading callback (the on-click event). Otherwise, these lines will be executed before the target items are available, i.e. $("#describestartdate") will return an empty list and nothing happens.

发布评论

评论列表(0)

  1. 暂无评论