Hello 🙂
I'm currently trying to figure out how to switch from the Data plugin to the Struct plugin.
In our wiki we use Bureaucracy forms to create new pages based on a template page.
However, while trying to adapt our current form (used with the Data plugin) to be now used with the Struct plugin I face an issue.
I cannot seem to force leading zeroes to the number that the user enter in the form.
Here is our OLD form (to be used with Data):
<form>
Action template namespace:template "namespace:TAC@@element number@@"
Thanks "element added to database - Information is stored on this page:"
Fieldset "New element"
Number "element number" "=Add number only, ""TAC"" will be added automatically" 000000
Textbox "reference" /^[abcd]+$/ "=Only reference letters a, b, c, d. No space either" "**Only reference letters a, b, c, d. No space either"
Textbox "Description" !
Date "Designed on" "=@YEAR@-@MONTH@-@DAY@" !
Textbox "Designed by" "=@NAME@"
Textarea "Remarks" x3 !
Fieldset "Add to list"
Submit "Add element"
</form>
Note the 000000 parameters at the end of the Number field
Now here is our NEW form (to be used with Struct):
<form>
Action template namespace:template "namespace:TAC@@element number@@"
Thanks "element added to database - Information is stored on this page:"
Fieldset "New element"
struct_field "testelements.number" "=Add number only, ""TAC"" will be added automatically" 000000
struct_field "testelements.reference" /^[abcd]+$/ "=Only reference letters a, b, c, d. No space either"
struct_field "testelements.description" !
struct_field "testelements.date_of_creation" "=@YEAR@-@MONTH@-@DAY@" !
struct_field "testelements.designer" "=@NAME@"
struct_field "testelements.remarks" x3 !
Fieldset "Add to list"
Submit "Add element"
</form>
However here the 000000 parameter has no effect.