Closed heikkilevanto closed 3 weeks ago
Got hard-coded wine subtypes to work, at least on my desktop machine. Not so much luck on my phone. (Firefox on both)
Did experiment with autocomplete='beertracker subtype'
which again works on my desktop. On t he desktop shows two lists of autocompletes, a generic one, and one for this field. Seems to do nothing on my phone.
Will need to collect various lists when parsing records, and make suitable lists of them. Something like beer names should depend on the brewery, so needs to be updated at runtime, in the browser.
Actually, for some fields a regular select type would be better. At least for wine subtypes and others that can be hardcoded to a well defined set.
Ah, I must be doing something right, as the suggestions work in Chrome on my phone.
Indeed, there is a suggestion to add this to Android Firefox: https://connect.mozilla.org/t5/ideas/firefox-mobile-amp-datalist
Looks like that is all I can do for now. Unless I want to implement a big javascript cludge that starts as a fixed list, but allows free text entry as well. Don't think I will get to it.
Closing this now. If Mozilla ever gets the datalists to work, the wine styles should magically start to work. Reopen then, and implement the same for many other fields. No point doing it before then.
See also a workaround in https://stackoverflow.com/questions/18082612/html5-datalist-tag-is-not-working-in-android#18082844
There is a way to pass a list of values to an input field, which makes the browser offer them as autocompletes. Make such lists for all fields, depending on the current record type, so switching to wine will prefill wine names and makers.
Also, pass some of the most recent entries to the JS. When entering a name, check if we know it, and in that case, prefill style, maker, alc, etc. (See also #59 for the leading-space trick not to overwrite human-entered values)