TYPO3 Fluid: Selectbox option with leading zero - typo3

I want to render a selectbox where you can select hour and minute:
<f:form.select property="minute" options="{0: '00', 5: '05', 15: 15, 30: 30, 45: 45}" />
This worked in earlier versions of TYPO3 (version 6.2), but in version 8.7 (and 10.4), the output is:
<select name="...">
<option value="0">0</option>
<option value="5">5</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
</select>
Isn't it possible to output <option value="0">00</option>?

I can only respond with "it does" :-) Try fluid here
https://fluidtypo3.org/library/try-fluid-now.html

Related

testing library userEvent.selectOptions does not select option

I have a React component which renders a combobox (another external component) with an option. When deployed the component does work as expected.
<select class="country-select"
id="nationalityCode" name="nationalityCode" required="">
<option value="" disabled="" hidden="">Choose</option>
<optgroup label="Most used">
<option value="0052">Belgium</option>
<option value="0055">German Citizien</option>
<option value="0057">French</option>
<option value="0001">Dutch</option>
</optgroup>
<optgroup label="Alle Nationalities">
<option value="0052">Belgium</option>
<option value="0055">German Citizien</option>
<option value="0057">French</option>
<option value="0001">Dutch</option>
<option value="0050">Albanese</option>
<option value="0223">American Citizen</option>
</optgroup>
</select>
When using testing library userEvent.selectOptions, the select of an option is successfull. Only the expect fails with
Error: expect(received).toBe(expected) // Object.is equality
Expected: true
Received: false
When debugging the selection state for all options it shows that the initial selected option is selected.
if (changeValue.nationaliteit) {
const selectOption = screen.getAllByRole('option', { name: 'French' })[0];
await userEvent.selectOptions(
screen.getByRole('combobox', { name: 'Nationaliteit' }),
selectOption
);
expect(
(screen.getAllByRole('option', { name: 'French' })[0] as HTMLOptionElement).selected
).toBe(true);
}
Using
"#testing-library/user-event": "^14.4.3",
"#testing-library/jest-dom": "^5.16.5",
"#testing-library/react": "^12.1.5",

how to forbid to screen reader read options length in select

CromeVox screen reader reads wrong options length for select.
Technically right, but not what I need.
<select name="month" id="month">
<option value="" disabled selected style="display: none;">Month</option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
It reads "combobox two of thirteen"
How to tell screen reader to not read list length at all or force it read "combobox two of twelve"?
https://jsfiddle.net/mrs_kva/5wk6xjt9/
I cant remove empty option.
UPD:
on w3.org presented example have this issue too
see here.
Despite there are 12 fruits in select reader says "13"

How do I update which option is selected based on EJS

I have a express server that passes in information from a mongo db into a ejs file. I am trying to update an item in the db. I want to have the current item information entered in as placeholders.
Here is the ejs code I'm not sure how to select one option based on the info from the db.
<select name="category" id="Category" placeholder="<%= product.category %>">
<option value="vegetable">Vegetable</option>
<option value="fruit">Fruit</option>
<option value="dairy">Dairy</option>
</select>
I understand that to have an option as the placeholder you generally have to use <option selected>
Any suggestions are much appreciated.
Use a Ternary Operator
<select name="category" id="Category">
<option value="vegetable" <%=product.category==='vegetable' ? 'selected' : '' %>>Vegetable</option>
<option value="fruit" <%=product.category==='fruit' ? 'selected' : '' %>>Fruit</option>
<option value="dairy" <%=product.category==='dairy' ? 'selected' : '' %>>Dairy</option>
</select>

using excel vba to change the value of a dropdown menu that after activate and populate a second dropdown menu

I am writin a macro excel to fill out a form in a web site.
My issue is that I can valorize the drop down menù (is a select command) but this should activate and populate a second drop down menù.. that does not appear
The code is
' this is the first select to choice the REGION
<select name="ctl00$cp$ddlRegion" id="ctl00_cp_ddlRegion">
<option value="">seleziona...</option>
<option value="13">Abruzzo</option>
<option value="17">Basilicata</option>
<option value="18">Calabria</option>
<option value="15">Campania</option>
<option value="08">Emilia-Romagna</option>
<option value="06">Friuli-Venezia Giulia</option>
<option value="12">Lazio</option>
<option value="07">Liguria</option>
<option value="03">Lombardia</option>
</select>
'the second select, depending from the region above, valorize the CITY
<select name="ctl00$cp$ddlProvince" id="ctl00_cp_ddlProvince">
<option value="">seleziona...</option>
<option value="070">Campobasso</option>
<option value="094">Isernia</option>
</select>
MY CODE IS:
IE.document.ALL("ctl00$cp$ddlRegion").Value = "03" ' that is LOMBARDIA
but after this line the value it appear.. but the second select does not activate.
I have tried with
IE.document.ALL("ctl00$cp$ddlRegion").focus
IE.document.ALL("ctl00$cp$ddlRegion").click
IE.document.ALL("ctl00$cp$ddlRegion").fireEvent ("onchange")
IE.document.ALL("ctl00$cp$ddlProvince").focus
IE.document.ALL("ctl00$cp$ddlProvince").disabled = false
BUT NOTHING... does anybody knows why......
thank you in advance
Alex

Custom data-attributes from select_tag not submitting - Rails 4

I have a simple search form_tag in a Rails 4 app.
One of the options is a select_tag:
<%= select_tag "plottable[plottable_id]", options_for_select(Plottable.all.map{ |plottable| [ plottable, plottable.id, { 'plottbale-type' => plottable.class } ] }), prompt: 'Select one option'%>
The HTML is generated properly, resulting in:
<select name="plottable[plottable_id]" id="plottable_plottable_id">
<option value="">Select one option</option>
<option plottable-type="Pool" value="3">Pool1</option>
<option plottable-type="Pool" value="4">Pool2</option>
<option plottable-type="Asset" value="33">Asset1</option>
<option plottable-type="Asset" value="34">Asset2</option>
</select>
When submitting the form the plottable-type does not get submitted. Here are the params:
Parameters: {"utf8"=>"✓", "from_time"=>"", "to_time"=>"", "plottable"=>{"plottable_id"=>"35"}, "commit"=>"Search"}
Thanks for your suggestions.
Just try this:
<select name="plottable[plottable_id]" id="plottable_plottable_id">
<option value="">Select one option</option>
<option plottable-type="Pool" value="3">Pool1</option>
<option plottable-type="Pool" value="4">Pool2</option>
<option plottable-type="Asset" value="33">Asset1</option>
<option plottable-type="Asset" value="34">Asset2</option>
</select>
<input type="hidden" name=plottable[type] value="", id="plottable_plottable_type">
$('#plottable_plottable_id').on('change', function(){
var type = $('option:selected', this).attr('plottable-type');
$('#plottable_plottable_type').val(type);
})
you can add hidden field tag by rails code as well
<%= hidden_field_tag "plottable[plottable_type]"%>