Updating member's birthday: month value does not show up right

5 posts by 3 authors in: Forums > CMS Builder
Last Post: November 20, 2012   (RSS)

By hiroko - November 17, 2012

Hi,
I am working with the date value for members to fill in their birthday.
I was able to find the code in the forum, but the month shows up as the current month 12 times in the pull down.
Like this:
November
November
November
November
November
November
November
November
November
November
November
November

Month:
<select name="month">
<?php foreach(range(1,12) as $month): ?>
<option value="<?php echo $month;?> <?php selectedIf($month,@$_REQUEST['month']);?>"><?php echo date("F",strtotime("0000-$month"));?></option>
<?php endforeach ?>
</select>


It works fine and I can update the records if I write like this :
Month:
<select name="month">
<?php foreach(range(1,12) as $month): ?>
<option value="<?php echo $month;?> <?php selectedIf($month,@$_REQUEST['month']);?>"><?php echo $month;?></option>
<?php endforeach ?>
</select>


Of course this only shows the numbers of the month. It's not a big problem for now, but it would be better to show up as January, February... and I am wondering why this is happening.

Thanks

Hiroko

Re: [hiroko] Updating member's birthday: month value does not show up right

Hi hiroko,

There must be something else going on outside of the specific code you posted.

When I mocked up the code in a viewer (CMSB version 2.14), I got the following:

January
February
March
April
etc.

Could you attach the entire viewer so someone can take a look?

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [greg] Updating member's birthday: month value does not show up right

Hi Greg,

Thanks for another new bit of information.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [greg] Updating member's birthday: month value does not show up right

By hiroko - November 20, 2012

Greg,

Thank you, this worked perfect!

hiroko