Forums

DB search field - leading zeros

msreyes 03 Sep, 2020
I have some REALLY bad data... that is besides the point. The lookup field is a VARCHAR - 6 characters long with leading zeros.

So number 1 would be 000001

When I use my form the field I use - how do I change the input mask/extra parameters/str_pad to add the leading zeros on submit. I know users will just type "1" for example to look for 000001 ..... but unless it is in that format, it does not return a result😟
Max_admin 03 Sep, 2020
Change the data using PHP before you use it for searching, for example, use a PHP action, fix the value, return the new value and use it in the "read data"
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.