J
|
Jane 10/26/2007 |
Hi, |
V
|
vytb author 10/26/2007 |
Hi, you can set up 0 as default value for your fields on the "Edit as" settings dialog on the Visual Editor tab or use Before record added/Before record updated events for this purpose.
|
J
|
Jane 10/26/2007 |
Vitas, if ($value<10) $value = "000".$value; if ($value>9 && $value<100) $value = "00".$value; if ($value>99 && $value<1000) $value = "0".$value; |
V
|
vytb author 10/26/2007 |
Thanks Jane, however the code for the list page does not affect codes in add/edit pages, thus zeros are not included in concatenation. How to solve this? |
![]() |
kujox 10/28/2007 |
Thanks Jane, however the code for the list page does not affect codes in add/edit pages, thus zeros are not included in concatenation. How to solve this?
|
V
|
vytb author 10/29/2007 |
You might be better looking at some javascript that will format the input box and make the table field a varchar, If it's a number it will drop any leading zeros but you could put them back in with $value = str_pad($value,4,"0",STR_PAD_LEFT); in the visual editor in a custom option
|
M
|
mmhsymon 6/23/2009 |
Thanks a lot, If I do this your way, zeros are still stripped before/while concat. However it's OK if I include str_pad in the concat formula.
|
J
|
Jane 6/24/2009 |
Hi, |