use the https://appstore.home.mendix.com/link/app/5958/TimeSeries/Set-Attribute for setting this:
put a class (in our case) hours on the textbox
This will show numeric keyboards on mobile, prevent chars other than 0 - 9 and a , and prevents copy/paste unwanted chars and with a maximum of 2 digits. Feel free to adjust ;-)
To go all the way you can also add some HTMLsnippets below to get some auto focus and select on the field on loading of the page with this:
setTimeout(function(){dojo.query('.hours input')[0].focus(); dojo.query('.hours input')[0].select(); },500);
and want to have a auto save function add this also (and make sure there is a mf button with the class saveButton and this button must have an on changeEvent to save your value). The focus will trigger that event :)
$('.hours').keypress(function (e) {
var key = e.which;
if(key == 13) // the enter key code
{
$('.saveButton')[0].focus();
return false;
}
});
Hi Pim,
I'm struggling to get this configured - I've tried the github to get the "test" project but It won't load. :(
Can you tell me where I'm going wrong?
I've entered the following settings
And this is on the page above next to the input text box:
and I've added the class to the textbox:
Cheers
Adrian