-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathform_cta.py
24 lines (21 loc) · 962 Bytes
/
form_cta.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from splashgen import launch
from splashgen.components import SplashSite, Form, TextInput, EmailInput, SelectInput
site = SplashSite(title="Form example")
site.headline = "Form example"
site.subtext = "This template illustrates how to add a custom form into your code"
# NOTE: You can omit the first argument to just use inputs with placeholders
inputs = [
TextInput(id="name", label="Name", required=True,
placeholder="First and Last"),
EmailInput(id="email", label="Email address", required=True),
SelectInput(id="role", label="Role", options=[
# You can specify a (text, value) tuple, or just provide text, and the
# value will be a slugified version of the text.
("CEO/Founder", "exec"),
"Engineer",
"Other"])
]
site.call_to_action = Form(endpoint="http://postman-echo.com/post",
inputs=inputs,
submit_text="Get Started")
launch(site)