บทที่ 8  New Input Types ตอนที่ 1
   New Input Types คือตัวลือกใหม่ที่ถูกเพิ่มใน HTML5 เพื่อให้เว็บไซต์ที่สร้างด้วย HTML5 สามารถปรับแต่งฟอร์มได้หลากหลายมากขึ้น โดยแท็กที่ใช้คือแท็ก <input>  ซึ่งหลายๆ Attribute นั้น มีประโยชน์และประหยัดเวลาในการทำเว็บไซด์อย่างมากเลยทีเดียว ตัวอย่างเช่น
1.Input Type: color
ใส่ค่าสี โดยค่าที่ใส่ อาจใช้เป็นรหัสสี หรือ ชื่อสีก็ได้ บราวเซอร์ที่สนับสนุน google chome ,opera

<html>
<body>

<form action="demo_form.asp">
  Select your favorite color: <input type="color" name="favcolor"><br>
  <input type="submit">
</form>

</body>
</html>

ผลลัพธ์คือ

2.Input Type: date
ใส่วันที่ โดยค่าที่ใส่จะเป็นตัวเลข เช่น ปี เดือน วัน (2012-03-07)  บราวเซอร์ที่สนับสนุน google chome ,opera,safari

<html>
<body>

<form action="demo_form.asp">
  Birthday: <input type="date" name="bday">
  <input type="submit">
</form>

</body>
</html>

ผลลัพธ์คือ

3.Input Type: datetime
ใส่วันที่และเวลา โดยค่าที่ใส่จะเป็น เช่น ปี เดือน วัน : เวลา(2012-06-22 T12:00) บราวเซอร์ที่สนับสนุน opera,safari

<html>
<body>

<form action="demo_form.asp">
  Birthday (date and time): <input type="datetime" name="bdaytime">
  <input type="submit">
</form>

</body>
</html>

ผลลัพธ์คือ

4.Input Type: email
ใส่อีเมล บราวเซอร์ที่สนับสนุน google chome ,opera,firefox

<html>
<body>

<form action="demo_form.asp">
  E-mail: <input type="email" name="usremail"><br>
  <input type="submit">
</form>

</body>
</html>

ผลลัพธ์คือ

5.Input Type: month
ใส่เดือนและปี  บราวเซอร์ที่สนับสนุน google chome ,opera,safari

<html>
<body>

<form action="demo_form.asp">
  Birthday (month and year): <input type="month" name="bdaymonth">
  <input type="submit">
</form>

</body>
</html>


ผลลัพธ์คือ


อ่านเพิ่มเติม
บทที่ 8 HTML5 New Input Types ตัวลือกใหม่สำหรับการปรับแต่งฟอร์มใน HTML5 ปรับแต่งฟอร์มได้หลากหลายมากขึ้น ตอนที่ 2

กระทู้ล่าสุดจากเว็บบอร์ด
หัวข้อกระทู้
ตอบ
เปิดดู
ล่าสุด
Delete base ไม่ได้ ช่วยดูหน่อย ครับ
โดย tangsupap อ 30 มี.ค. 2010 8:27 am บอร์ด SQL - Database
1
1362
อ 30 มี.ค. 2010 8:50 am โดย ob1 View Topic Delete base ไม่ได้ ช่วยดูหน่อย ครับ
เรื่อง tag form ในไฟล์ของผมมันไม่มี แต่มันมี form อยู่
โดย illustika จ 29 มี.ค. 2010 7:31 pm บอร์ด HTML CSS
1
3889
อ 30 มี.ค. 2010 2:09 am โดย mindphp View Topic เรื่อง tag form ในไฟล์ของผมมันไม่มี แต่มันมี form อยู่
เรื่อง php.cgi
โดย Anonymous จ 29 มี.ค. 2010 2:40 pm บอร์ด Programming - PHP
5
1114
อ 30 มี.ค. 2010 2:12 pm โดย บุคคลทั่วไป View Topic เรื่อง php.cgi
ใช้ LaiThai e-Commerce Edition VM 1.1.4 ร่วมกับ Dynmic DNS แล้วมีปัญหาครับ
โดย kunkarin จ 29 มี.ค. 2010 11:37 am บอร์ด สอบถามปัญหาการใช้ phpBB3, SMF, Joomla, Wordpress, CMS, CRM
2
1950
พฤ 26 พ.ย. 2020 11:07 pm โดย mindphp View Topic ใช้ LaiThai e-Commerce Edition VM 1.1.4 ร่วมกับ Dynmic DNS แล้วมีปัญหาครับ
ATOM
โดย tawat จ 29 มี.ค. 2010 11:36 am บอร์ด Programming - C/C++ & java & Python
2
1615
พ 10 พ.ย. 2010 3:55 pm โดย gangwell View Topic ATOM
ปัญหาการเข้าจัดการเว็บไซต์
โดย natthawat44 อ 28 มี.ค. 2010 12:53 am บอร์ด สอบถามปัญหาการใช้ phpBB3, SMF, Joomla, Wordpress, CMS, CRM
1
882
อ 28 มี.ค. 2010 1:19 am โดย mindphp View Topic ปัญหาการเข้าจัดการเว็บไซต์
ใช้ php รันโปรแกรม .exe โปรแกรมทำงานแต่หน้าเว็บค้าง ครับ
โดย witkot ศ 26 มี.ค. 2010 4:20 pm บอร์ด Programming - PHP
6
4803
พฤ 01 เม.ย. 2010 11:36 pm โดย witkot View Topic ใช้ php รันโปรแกรม .exe โปรแกรมทำงานแต่หน้าเว็บค้าง ครับ
php+telnet
โดย Anonymous อ 21 มี.ค. 2010 6:21 pm บอร์ด Programming - PHP
1
1355
ส 27 มี.ค. 2010 6:52 am โดย บุคคลทั่วไป View Topic php+telnet