-
Notifications
You must be signed in to change notification settings - Fork 300
Expand file tree
/
Copy pathfields-hidden-autocomplete.yml
More file actions
53 lines (53 loc) · 1.27 KB
/
fields-hidden-autocomplete.yml
File metadata and controls
53 lines (53 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
metadata:
title: Address autocomplete with hidden field
short title: Autocomplete
example start: 1
example end: 4
documentation: "https://docassemble.org/docs/fields.html#hidden"
---
objects:
- doctor: Person
---
question: |
Who is your doctor?
fields:
- Name: doctor.address.name
address autocomplete:
types:
- doctor
fields:
- address_components
- geometry
- name
- place_id
- Address: doctor.address.address
- Unit: doctor.address.unit
required: False
- City: doctor.address.city
- State: doctor.address.state
code: states_list()
- Zip: doctor.address.zip
- field: doctor.address.place_id
input type: hidden
- field: doctor.address.latitude
datatype: number
input type: hidden
- field: doctor.address.longitude
datatype: number
input type: hidden
validation code: |
if not doctor.address.place_id:
validation_error('You need to choose a doctor from the drop-down list.')
---
depends on:
- doctor.address.name
code: |
doctor.name.text = doctor.address.name
---
mandatory: True
question: |
The `place_id` of ${ doctor } is
`${ doctor.address.place_id }`.
subquestion: |
The office is located at
`${ repr((doctor.address.latitude, doctor.address.longitude)) }`.