Best method for implementing date selection drop downs in a form?

If you could lead me in the right direction it would be greatly appreciated

for this instance I think drop down boxes work better.

Here’s what I would generally do. How would I implement this in a yii form?

I’d be using this for things like user registration, user update info.

Don’t mind the tables :slight_smile:

Thanks


<font class="small"><b>Date of Birth</b></font></td>

 

 

 	<!--DOB-->	

	<td>

	<table cellpadding="0" cellspacing="0" border="0">

	<tr>

	<td><select name="month">


		<option value="" selected>mm</option>

<?php

for ($i = 1; $i <= 12; $i++) {

?>

  <option value="<?php echo $i; ?>"><?php echo $i; ?> </option>

<?php

} 

?>

	</select>

	

	/ 

	<select name="day">

    

	<option value="" selected>dd</option>


<?php 

for ($i = 1; $i <= 31; $i++) {

?>

  <option value="<?php echo $i; ?>" <?php if($dayy == $i){ echo " selected"; } ?>><?php echo $i; ?> </option>

<?php

} 

?>

	</select>

	/ 

	<select name="year">

    

	<option value="" selected>yyyy</option>


<?php 

for ($i = 1930; $i <= 2000; $i++) {

?>

  <option value="<?php echo $i; ?>" <?php if($dayy == $i){ echo " selected"; } ?>><?php echo $i; ?> </option>

<?php

} 

?>

	</select>

	</td></tr></table>

 

http://www.yiiframework.com/doc/api/1.1/CJuiDatePicker ? ;)

yeah I already checked that out, but is the only option to use the jquery plugin?

I just want drop downs not the calendar

In Yii nothing its “the only option” :D you can do it the way you want, but… i don’t see why would you prefer dropdowns instead of a calendar…

I guess if I enable the drop down boxes in the calendar it’ll d0

its for picking a birthdate so the drop downs would make it easier in terms of year

DatePicker can be configured to show dropdowns ;)

http://jqueryui.com/demos/datepicker/#dropdown-month-year