Question
Want to add Dynamic Mobile number
as i have written the following code .. but how to increase the index.. i
if user clicks on add new .. new field of mobile number should get added..
a!localVariables(
local!add ,
local!npi,
a!sideBySideLayout(
items: {
a!forEach(items: local!npi,expression:
a!sideBySideItem(
item: a!textField(
label: "Mobile Number",
labelPosition: "ABOVE",
value: fv!item,
saveInto: fv!item,
validations: if(
a!isNullOrEmpty(fv!item),
{},
if(
not(
regexmatch("^([0-9]{" & 10 & "})$", fv!item)
),
"Maximum " & 10 & " digits are allowed",
""
)
)
))
),
a!sideBySideItem(
item: a!linkField(
label: "",
links: {
a!dynamicLink(
label: "Add New",
value: {
local!npi + 1
},
saveInto: {
a!save(local!npi, append(local!npi, save!value))
}
)
}
)
)
},
)
)