How to set up form fields (placeholders, required, types)
In TeleportHQ, each form field's settings are in the right panel, in the Attributes section. Select the field on the canvas, then change placeholder (the grey hint text), switch on required so visitors can't skip it, pick a type such as email or tel, and set name, which becomes the field's column title in your submissions.
Before you start
- Add a form with fields first. See How to create a form.
- Fields added with + Add elements already have a sensible type, name and placeholder. For example, Email gets the type
email, the nameemailand the placeholder "Email". - To check what visitors type (a phone number, a postal code, a text length) and show your own message when a value is refused, use the form's Field rules instead. They set the same attributes for you. See How to check what visitors type in a form field.
Steps
- On the canvas, click the field you want to change, for example the Phone input.
- In the right panel, find the Attributes section. If it's folded, click its title.
- Change the settings you need:
- placeholder: type the hint shown inside the empty field, for example
+1 555 123 4567. - required: turn it on to stop the form from sending while the field is empty.
- type: choose what the field accepts:
text,number,email,password,tel,date,timeordatetime-local. - name: type a short name without spaces, for example
phone.
- placeholder: type the hint shown inside the empty field, for example
- Repeat for the other fields.
Settings for each kind of field
In TeleportHQ, the Attributes section shows different settings depending on the field:
| Field | Settings in Attributes |
|---|---|
| Input (single line) | type, name, value, placeholder, disabled, required, autoFocus, autoComplete |
| Textarea (long answer) | name, placeholder, cols, rows, disabled, autoFocus, autoComplete |
| Checkbox and Radio Button | name, defaultChecked, checked, disabled, required, autoFocus, autoComplete, value |
| Select (dropdown) | name, multiple, size, disabled, required, autoFocus, autoComplete |
| Option (a dropdown choice) | disabled, value |
| Label | for |
| Button | name, disabled, autoFocus, type (submit, reset, button) |
Tips:
- Dropdown choices. A Select holds Option elements. Select an option to edit its text and its value. To make a dropdown required, give its first option an empty value, such as a "Choose a size" option: the dropdown counts as empty while that option is chosen.
- Radio buttons. Give every radio button in a group the same name, so visitors can pick only one.
- Submit button. Make sure the button's type is
submitor empty. A button with the typebuttondoesn't send the form. - autoComplete lets browsers fill in known details. For example, set it to
emailon an email field.
How field names appear in your submissions
TeleportHQ uses each field's name as its column title in the Submissions tab, with the first letter of each word in capitals: a field named phone becomes the Phone column. The same name labels the field in notification emails, the CSV download and the PDF of a submission. A field without a name gets one made up by TeleportHQ, such as textinput k3j2f, so give each field a clear name before you publish.
Check that it worked
- Click Preview in the toolbar at the bottom of the editor, or open your published site.
- Try to send the form with a required field empty. The browser asks you to fill it in.
- Type a wrong email into an
emailfield. The browser warns you.
Troubleshooting
My answers show up under odd column names in Submissions The fields had no name, so TeleportHQ made one up. Give each field a clear name, such as phone or message, and publish again. New submissions use the new names.
The placeholder text doesn't change on the live site Publish again after editing. Changes in the editor reach your live site only when you publish.
The form sends even though a field is empty Check that required is on for that field, and that the field sits inside the Form element. A Textarea has no required setting in Attributes: use Required in the form's Field rules. See How to check what visitors type in a form field.
Good to know
- To style placeholder text, for example a lighter grey, add a CSS rule with custom code. See How to add code to every page (head and body).
- For file attachments, use the File Upload Field instead of an input with the type
file. See How to let visitors upload files in a form.