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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Mihael Konjević
July 11, 2014
Programming
1
570
can-form
Presentation of the can-form plugin -
https://github.com/retro/can-form
Mihael Konjević
July 11, 2014
Tweet
Share
More Decks by Mihael Konjević
See All by Mihael Konjević
Developing (with) Keechma
retro
1
270
File uploading with can.Component and jQuery-file-upload
retro
0
660
JSON Schema and APItizer
retro
2
280
Event Oriented Architecture and Client side apps
retro
2
610
Other Decks in Programming
See All in Programming
条件判定に名前、つけてますか? #phperkaigi #c
77web
1
250
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
140
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
240
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
230
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
120
SourceGeneratorのマーカー属性問題について
htkym
0
200
CSC307 Lecture 14
javiergs
PRO
0
480
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1.1k
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
160
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.9k
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
520
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
440
Featured
See All Featured
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
110
GraphQLとの向き合い方2022年版
quramy
50
14k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
290
Claude Code のすすめ
schroneko
67
220k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
So, you think you're a good person
axbom
PRO
2
2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.5k
エンジニアに許された特別な時間の終わり
watany
106
240k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
94
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
110
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
100
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