When you display data from a Wix database on a page using a text box, you run into formatting problems:
- date is shown as standard Javascripts Long Date (" Tue Aug 01 2017 00:00:00 GMT+0200 (Hora de verano romance) ")
- amounts cannot be trailing-zero stripped or rounded
- time has to be extracted from a date
All this can be done in Javascript, but is tedious and superfluous. Might I suggest the standard Text Box is enhanced with functionality like you get in a spreadsheet cell: a couple of types (Date, Text, Number, Currency, etc) with some standard formatting options (DD/MM/YYYY, negative numbers in red or with leading minus sign, EUR, USD with rounding and trailing zero´s handling).
I tried using User input fields, but since a dynamic page is read-only for visitiors, content (and, if used, box border) is greyed out, an effect you might not want.
1 Like
Thanks for the feature request. We will take this into consideration.
As per your workaround with input elements, I think you might be able to make this work. Using the input’s design button, you can change the design of the disabled state of the input element to look as if it is not disabled.
Thank you, I will try that.
And if you decide to enhance the text box, could you please take into consideration the following, regarding dates: when developing multi-lingual sites, it would be ideal if you could set a system wide date format, like MM/DD/YYYY. If a user then selects the German site, you only have to set (in code) the system wide date into DD-MM-YYYY. This saves you having to reformat every date field in code again , which would make the added functionality of being able to set a format spreadsheet-like useless.
Does that make sense?
I have a database storing the price of property as a number 1234567 how do I make the number display in a textbox as 1.234.567 ?