R
R
runapa2019-11-10 20:25:48
User interface
runapa, 2019-11-10 20:25:48

How to arrange the input of dates of different accuracy in the form, depending on the type of event?

I'm doing something like an event scheduler, and the events themselves are divided into two types. The former go with an accuracy of up to a month, while the latter require an exact date - up to a day. The question is how to organize it at the level of the html form. It is clear that you can make two separate fields, but I would like to avoid this. I don't find it beautiful.
Threat. I am using datetimepicker.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Karpion, 2019-11-10
@runapa

It is not clear to me from the question - how the program (client script or server script) distinguishes one event from another.
Let's say the form consists of the first field, by which you can determine the type of event - monthly or daily. After filling out this form, the second field is shown with the required accuracy.
Or you can create a date field (or three fields - year / month / day). The user enters there or two fields, or three - as he wants, And at the stage of processing the request, he is informed if the accuracy of the date does not correspond to the type of event.
PS: Imagine that the event scheduler you need has already been created, but it is not available to you - something like "the computer on which it works is available only to a specially trained operator." And you can communicate with the operator by giving him notes on paper.
So write both notes to the operator. Fashionable on a clean sheet, you can form a typographic request form. So that the operator clearly understands what it is about. And it will immediately become clear to you how to do this in HTML.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question