Platform
Resources
Pricing
Sign in
Get started
Saneef H. Ansari
Consultant Designer & Developer
Workspace
Fork
Public
By
Saneef H. Ansari
Edited
Jan 11, 2023
Insert cell
Insert cell
Insert cell
Insert cell
viewof
textInput
=
Inputs
.
text
(
{
label
:
"Input 1"
}
)
Insert cell
textInputIsEmpty
=
textInput
.
length
===
0
Insert cell
viewof
storeForInput2
=
Inputs
.
input
(
)
Insert cell
Insert cell
storeForInput2
Insert cell
{
if
(
!
textInputIsEmpty
)
{
return
Inputs
.
bind
(
Inputs
.
text
(
{
label
:
"Input 2 (dependent)"
}
)
,
viewof
storeForInput2
)
;
}
return
md
``
;
}
Insert cell
{
if
(
!
textInputIsEmpty
&&
storeForInput2
.
length
!==
0
)
{
return
md
`Neither is empty!`
;
}
else
if
(
storeForInput2
.
length
===
0
)
{
return
md
`First isn't empty, but the second is!`
;
}
return
md
``
;
}
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
textInput
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
textInputIsEmpty
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
storeForInput2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML