Dec 31st, 2011, 5:36 PM
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.
Thanks for the ideas, and I look forward to the form builder module ;-)
-Alex
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">
function addSlashes(input) {
var v = input.value;
if (v.match(/^\d{2}$/) !== null) {
input.value = v + '/';
} else if (v.match(/^\d{2}\/\d{2}$/) !== null) {
input.value = v + '/';
}
}
</script>
Thanks for the ideas, and I look forward to the form builder module ;-)
-Alex
(Dec 31st, 2011, 11:26 AM)Ben Wrote: 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