From d58c9bd1c2ecfcbea5e99df169612909b2968034 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Thu, 2 Jan 2020 11:53:10 -0500 Subject: [PATCH] Updated Home (markdown) --- Home.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Home.md b/Home.md index ece48a1..a3182e1 100644 --- a/Home.md +++ b/Home.md @@ -72,3 +72,12 @@ To display each type of help text, add a custom property: | Placeholder text | `placeholder` | `Enter your email address here` | | Description text | `description` | `Upload a digitally-signed PDF file that is no more than 1GB in size.` | | Placeholder text | `help` | `# This is a large heading\n\nParagraph of text goes here.\n\nThe next paragraph goes here. You can even insert [links](https://sartography.com)!\n\nThis is a list:\n- Apples\n- Oranges\n- Bananas` | + + +#### Dynamic labels + +If the text label of a field needs to change based on the value of some other field(s) in the form, you can use a Formly Javascript expression (see above). The example below uses a ternary (if/then) operator to display a different label if the field `dogName` is filled out. + +| Property > Id | Property > Value (example) | +| ------------- | -------------------------- | +| `label_expression` | `!!model.dogName ? 'How old is ' + model.dogName + '?' : 'How old is your dog?'` |