changing attribute name, not value, with form controls in Author View
Posted: Sat May 07, 2022 1:52 pm
Hi.
I have a date picker form control like this:
It works as expected and it enters the date into the `@when` attribute. So far so good.
In TEI, however, we need to use a different attribute for inexact dates, either `@notBefore` or `@notAfter`. So, next to the date picker, I'd like to add an oxy_comobox with the default value `@when`, and two additional values `@notBefore` and `@notAfter`, and then an oxy_action onChange that would replace `@when` with the selected attribute name (`@notBefore` or `@notAfter`) and keep the date picker working with the new attribute.
Is this something that can be done? If not, what's the most elegant way of giving the user this kind of choice without overcrowding the form?
Many thanks in advance.
All best,
Toma
I have a date picker form control like this:
Code: Select all
correspAction date:before {
font-family: "Platforma Sans", sans-serif;
content:
oxy_label(text, "Датум: ", width, 30%)
oxy_datePicker(edit, '@when', width, 23%, format, 'yyyy-MM-dd', fontInherit, true, color, inherit);
}
In TEI, however, we need to use a different attribute for inexact dates, either `@notBefore` or `@notAfter`. So, next to the date picker, I'd like to add an oxy_comobox with the default value `@when`, and two additional values `@notBefore` and `@notAfter`, and then an oxy_action onChange that would replace `@when` with the selected attribute name (`@notBefore` or `@notAfter`) and keep the date picker working with the new attribute.
Is this something that can be done? If not, what's the most elegant way of giving the user this kind of choice without overcrowding the form?
Many thanks in advance.
All best,
Toma