M
Mark Mr
Hi guys. I have a form to submit an assessment for one of my web apps.
The model contains a datetime field called ends_at which is when the
assessment is supposed to end. Before, I had a datetime_select field for
this, but I put in a calendar popup to do the date for them. However, I
also need them to choose the time as well so this is initially what i
came up with
<%= date_field 'assessment', 'ends_at', :value => "Click here..." %>
<%= time_select 'assessment', 'ends_at'%>
But unfortunately this replaces the date they selected with today's date
because it discards the first date field after it reads the time one.
Basically i want to know if there's a way to somehow combine the date
and the time fields in the form and perhaps pass them in a hidden field
to the controller. I don't know how to interact with the values inside
fields before they're submitted. Or if anyone has another suggestion on
how to make that work I'd take that too thanks alot!
The model contains a datetime field called ends_at which is when the
assessment is supposed to end. Before, I had a datetime_select field for
this, but I put in a calendar popup to do the date for them. However, I
also need them to choose the time as well so this is initially what i
came up with
<%= date_field 'assessment', 'ends_at', :value => "Click here..." %>
<%= time_select 'assessment', 'ends_at'%>
But unfortunately this replaces the date they selected with today's date
because it discards the first date field after it reads the time one.
Basically i want to know if there's a way to somehow combine the date
and the time fields in the form and perhaps pass them in a hidden field
to the controller. I don't know how to interact with the values inside
fields before they're submitted. Or if anyone has another suggestion on
how to make that work I'd take that too thanks alot!