DateTime Picker

Avatar

Avatar

sbudlong

Avatar

sbudlong

sbudlong

06-08-2010

I have an interactive form where the user has to fill in the date and time of an incident. Is there javascript or FormCalc code availabe in these forums or online that can achieve this? Or is it best to use the Date field object? That allows the user to pick a date from the dropdown, but for the time, the user would have to fill that in manually, which is an outcome I'd like to avoid, if possible. Thank you for any advice or suggestions you may have.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

John_C_Cummins

Avatar

John_C_Cummins

John_C_Cummins

06-08-2010

The easiest thing for you would probably be to have them enter the date in a date picker and then the time separately. You have two opotions for the time:

1) Create a text field with a custom pattern that validates the way they enter data. You could create a default time in the format you want them to use.

2) Create drop down lists for the hours and minutes. The user selects those and then you can use JavaScript to store the values in whatever format you want.

Hope this helps!

Answers (3)

Answers (3)

Avatar

Avatar

sbudlong

Avatar

sbudlong

sbudlong

06-08-2010

John, thank you for your suggestions. That definitely seems to be the best approach. Thank you for your help!

Avatar

Avatar

sbudlong

Avatar

sbudlong

sbudlong

06-08-2010

Srini,

I need the latter.

But if the user wants to fill their own date and time then probably you need to have different controls to capture the input..

What controls would I need? And do I take it that one control won't do it. I'll need one for Date and a second for Time.

Avatar

Avatar

Srini_Dhulipall

Avatar

Srini_Dhulipall

Srini_Dhulipall

06-08-2010

You can write script to log the date and time the form is opened or the form submitted etc..

But if the user wants to fill their own date and time then probably you need to have different controls to capture the input..

Thanks

Srini