Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
can-form
Search
Mihael Konjević
July 11, 2014
Programming
570
1
Share
can-form
Presentation of the can-form plugin -
https://github.com/retro/can-form
Mihael Konjević
July 11, 2014
More Decks by Mihael Konjević
See All by Mihael Konjević
Developing (with) Keechma
retro
1
280
File uploading with can.Component and jQuery-file-upload
retro
0
670
JSON Schema and APItizer
retro
2
290
Event Oriented Architecture and Client side apps
retro
2
610
Other Decks in Programming
See All in Programming
感情を設計する
ichimichi
5
1.5k
第3木曜LT会 #28
tinykitten
PRO
0
110
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
190
Programming with a DJ Controller — not vibe coding
m_seki
3
150
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
170
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
290
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
140
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
590
アーキテクチャモダナイゼーションとは何か
nwiizo
19
5.4k
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
220
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.5k
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
110
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
350
Bash Introduction
62gerente
615
210k
Amusing Abliteration
ianozsvald
1
160
New Earth Scene 8
popppiees
3
2.1k
How to Talk to Developers About Accessibility
jct
2
180
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
370
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
280
How to train your dragon (web standard)
notwaldorf
97
6.6k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
510
WENDY [Excerpt]
tessaabrams
10
37k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
320
Transcript
can-form Awesome forms for CanJS
Why? • validations and error reporting is a pain •
similar code written over and over again • how do you handle nested object structures?
can-form • can-value is great, use it • behaves like
the can.Component • composable / nestable (allows it to handle nested structures) • validations on the form (validations are bound to context) • simple error reporting and tracking
API FormComponent.extend({ tag : 'simple-form', template : '<content><content>', validate :
{ username : [FormComponent.validationRules.presenceOf()], password : [FormComponent.validationRules.presenceOf()] } }); <simple-form map="{userModel}"> <input type="text" can-value="username"> {{#errors 'username'}} <ul class="bg-danger list-unstyled"> {{#this}} <li>{{ . }}</li> {{/this}} </ul> {{/errors}} <input type="text" can-value="password"> {{#errors 'password'}} <ul class="bg-danger list-unstyled"> {{#this}} <li>{{ . }}</li> {{/this}} </ul> {{/errors}} <button>Submit</button> </simple-form>
API FormComponent.extend({ tag : 'simple-form', template : '<content><content>', validate :
{ username : [FormComponent.validationRules.presenceOf()], password : [FormComponent.validationRules.presenceOf()], 'socialNetworks.*.username' : [FormComponent.validationRules.presenceOf()], 'socialNetworks.*.network' : [FormComponent.validationRules.presenceOf()] } });
API <simple-form map="{userModel}"> <input type="text" can-value="username"> {{#errors 'username'}} <ul class="bg-danger
list-unstyled"> {{#this}} <li>{{ . }}</li> {{/this}} </ul> {{/errors}} … ! {{#each socialNetworks}} <form-for map="{this}" path="socialNetworks.{{@index}}"> <input type="text" can-value="network"> // error reporting code here <input type="text" can-value="username"> // error reporting code here </form-for> {{/each}} <button>Submit</button> </simple-form>
API FormComponent.extend({ tag : 'social-network', template : socialNetworkTemplate, validate :
{ username : [FormComponent.validationRules.presenceOf()], network : [FormComponent.validationRules.presenceOf()] } })
API <simple-form map="{userModel}"> <input type="text" can-value="username"> {{#errors 'username'}} <ul class="bg-danger
list-unstyled"> {{#this}} <li>{{ . }}</li> {{/this}} </ul> {{/errors}} ! … ! {{#each socialNetworks}} <social-network map="{this}" path="socialNetworks.{{@index}}"> </social-network> {{/each}} ! <button>Submit</button> </simple-form>
github.com/retro/can-form @mihaelkonjevic