HashanChamara / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
0 stars 0 forks source link

Birthdates #101

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

Great class. The only issue I am currently having with it, is attempting to get 
a birthdate entry using the addDate, I know I can easily accomplish this with a 
generic addTextbox (which is what I am resorting to). However, it would be 
awesome to have the addDate functionality with a birthdate. IE: Date is from 
today - 100 years or so. I did try a few different settings, but none worked. 
If this functionality already works I would love to know how (And it might be 
worth adding that to the documentation) given a birthdate is a common item for 
any type of registration system (COPPA reasons). Thanks bud!

What version of the product are you using? On what operating system?
1.1.4 Debian Apache

Original issue reported on code.google.com by prem...@gmail.com on 6 Dec 2010 at 6:43

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Figured it out via the jQuery DatePicker information. 

This would be a great addition though: addBirthdate()  to avoid the need to 
manually set it all up. For anyone looking for it here is the code: 

$form->addDate('Birthdate: ', 'birthdate', '', array(
            "jqueryOptions" => array(
            "dateFormat" => "yy-mm-dd",
            'yearRange' => date('Y', strtotime('-100 year')) . ':' . date('Y', strtotime('3 year')),
            'defaultDate' => date('Y-m-d', strtotime('-13 year')),
        )));

Original comment by prem...@gmail.com on 6 Dec 2010 at 7:00

GoogleCodeExporter commented 8 years ago
Amendment:

'yearRange' => date('Y', strtotime('-100 year')) . ':' . date('Y', 
strtotime('-3 year')),

Original comment by prem...@gmail.com on 6 Dec 2010 at 7:01

GoogleCodeExporter commented 8 years ago
Yep, you got it.  The last example - "Date w/Modified Year Range:" - at 
http://www.imavex.com/php-form-builder-class/examples/jquery.php#date demos 
this functionality.

- Andrew

Original comment by ajporterfield@gmail.com on 6 Dec 2010 at 7:06

GoogleCodeExporter commented 8 years ago
Ah, thanks for that. I was just looking in the wrong area. 

Original comment by prem...@gmail.com on 6 Dec 2010 at 8:13

GoogleCodeExporter commented 8 years ago
The current documentation section is definitely lacking, so I'm impressed that 
you figured it out in the first place:)  Best of luck in the rest of your 
development.

- Andrew

Original comment by ajporterfield@gmail.com on 6 Dec 2010 at 8:21