The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Date of Birth - Best way to collect from form - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Date of Birth - Best way to collect from form (/showthread.php?tid=1837) |
Date of Birth - Best way to collect from form - alexh - Dec 28th, 2011 I want to have the user enter their date of birth in a form field on an external form. What is the best way to do this? If I leave a blank text field, people will enter it differently than others.. and if I do three separate fields (day, month, and year), I won't be able to put them together into one field in the database. Any ideas?? Thanks! RE: Date of Birth - Best way to collect from form - Ben - Dec 31st, 2011 Hi Alex, I *KNOW*! This has been a recurring problem for us too. These days we rely on using a javascript calendar (jQuery UI has a nice one), which stores the info in a single field. That's probably your best approach - both for ensuring that 99% of users will submit the data in the same format, but also for usability's sake (they're very easy to use). You can use 3 separate fields, but I agree: having them split up in the UI is pretty crumby. What I've done in the past is use the Submission Pre-Parser module to piece together the info to store it in a single field - not great, but passable. Sorry to keep mentioning the upcoming Form Builder module in my posts (I'm just working on it all the time now), but it'll let automatically insert date, datetime and time fields into your published forms - just like with the FT interface. It'll be released soon. Really. (I'm knee deep in QA right now). - Ben RE: Date of Birth - Best way to collect from form - alexh - Dec 31st, 2011 Thanks Ben! That totally makes sense. I suppose if I was able to piece the fields back together into one, I could do a drop down for month, day, and year... and that would solve the problem. For now I used a java script to auto-add slashes... and then used java to require the format to require the four digit year. Code: <script type="text/javascript"> Thanks for the ideas, and I look forward to the form builder module ;-) -Alex (Dec 31st, 2011, 11:26 AM)Ben Wrote: Hi Alex, |