Skip to Content
MOBILE WEB程式設計--第二版
book

MOBILE WEB程式設計--第二版

by Maximiliano Firtman
December 2013
Intermediate to advanced
752 pages
16h
Chinese
GoTop Information, Inc.
Content preview from MOBILE WEB程式設計--第二版
254
|
第八章
traditionalhanzi
user
可用的修飾符為:
lowerCase
upperCase
titleCase
startUpper
digits
symbols
predictOn
predictOff
其他表單屬性
HTML5 問世之前,每一個表單控制項都必須位於
form
元素之內,在 JavaScript 之外
獨立動作。從 HTML5 開始,我們可以對表單元素套用一些新的屬性,藉以定義應該套
用控制項的表單。雖然如此,我們必須謹慎應付行動瀏覽器,因為它們的相容性還不是
很好,我們也仍然無法輕鬆地創建回退機制。
在這個種類當中,我們可以發現一些屬性,如
form
(指定一或多個
input
元素所屬的
表單)、
formnovalidate
(不想在提交表單時進行驗證的元素),以及按鈕專用屬性,如
formaction
formenctype
formmethod
formtarget
表單驗證
為了減少用戶端的指令碼及伺服器端的驗證程式,並增進表單的便利性,我們應該盡可
能提供大量的輸入驗證屬性。
第一個典型的選項,是使用
maxlength
屬性來為文字定義最大輸入長度,它代表字元數
量。當使用者輸入文字時,許多平台會自動添加字元計數器。第二個熱門的選項是為
input
元素定義正確的輸入類型,例如
number
date
。它們絕對可以增進便利性,並改
善驗證過程。
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

成為卓越程式設計師的38項必修法則

成為卓越程式設計師的38項必修法則

Pete Goodliffe
精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly

Publisher Resources

ISBN: 9789862769522