Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm hoping to enhance an existing plugin's setting page by adding an 'end date' form. I know how to add text and other form fields but was wondering if there is standard function that will render a year/data/time form. No sense in re-inventing the wheel.

Thanks for all tips.

share|improve this question

1 Answer 1

Could this work for you?

<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/base/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("#datepicker").datepicker({
        onSelect: function(dateText, inst) { $("#thedate").val(dateText); } }); 
    });
</script>

<table>
    <tr>
    <td style="vertical-align:top;">
            <h3>End Date</h3>
        </td>
    <td>
        <ul>
            <li><p>(Pick a date from the calendar below)</p></li>
            <li>
                <div style="margin-bottom:5px;" type="text" id="datepicker"></div>
            </li>
            <li>
                Date Selected: <input type="text" id="thedate" name="date"/> 
            </li>
        </ul>
    </td>
</td>
</tr>
</table>
share|improve this answer
    
Thanks rman. I was actually looking for a standard framework but this script method will do just nicely. [newb] –  awoz Aug 2 '11 at 0:40
    
lol, no idea why this was voted down -1; seems prefectly good code to me. –  Graeme Aug 23 '11 at 0:15
    
I concur (why voted down), the suggested code worked nicely. –  awoz Dec 15 '11 at 19:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.