Results 1 to 2 of 2

Thread: Function ควบคุม textbox , textarea (Javascript)

  1. #1
    Junior Member
    Join Date
    Dec 2007
    Posts
    0


    Function ควบคุม textbox , textarea</span>

    Parameters:
    <blockquote> Expression = a..z (รับเฉพาะตัวอักษร)
    <blockquote><blockquote>0..9 (รับเฉพาะตัวเลข)</blockquote></blockquote></blockquote>
    Example:
    <blockquote>ใช้ onKeyPress event ที่ <input type=”textbox” onKeyPress=”AllowOnly(‘a..z’)” />
    //รับ a ถึง z
    onKeyPress="AllowOnly(&#39;a..z&#39;"

    //รับ 0 ถึง 9
    onKeyPress="AllowOnly(&#39;0..9&#39;"

    //รับเฉพาะ a,b,c,1,2 และ 3
    onKeyPress="AllowOnly(&#39;abc123&#39;"

    //รับเฉพาะ a ถึง z,@,#,$ และ %
    onKeyPress="AllowOnly(&#39;a..z|@#$%&#39;"

    //รับเฉพาะ a,b,c หรือ 0 ถึง 9 หรือ .,,,+ และ -
    onKeyPress="AllowOnly(&#39;abc|0..9|.,+-&#39;"</blockquote>
    Remarks:
    <blockquote>1. ใช้ "|" แทนคำว่า or ขั้นเพื่อเพิ่มเงือนไขมากกว่า 1 อย่าง
    2. ตัวอักษร a แทนทั้ง a และ A </blockquote>
    <span style="color:#990000">Function:


    [hide=10][code]function AllowOnly(Expression)
    {

  2. #2
    Junior Member
    Join Date
    Dec 2007
    Posts
    0


    ไปหา อ่านที่ www.w3schools.com เป็นพื้นบานที่ดีสำหรับการเขียนเวป รวมถึงการเขียนAjax
    ถ้าสนใจเขียน Ajax ให้ใช้ Aptana เขียนดีมากเลยหา bug ในAjaxได้ง่ายมาก แถมใช้ php ruby onrail ได้โดย
    download ที่ www.aptana.com/

Similar Threads

  1. Replies: 8
    Last Post: 10-06-2009, 12:13 PM
  2. การ copy ข้อความใน textarea
    By opormunza in forum แนะความรู้ด้าน Programming ต่างๆ
    Replies: 0
    Last Post: 11-05-2009, 11:06 AM
  3. Replies: 1
    Last Post: 11-09-2008, 09:37 PM
  4. ควบคุม IE
    By controlman in forum Computer Tip & Trick / Tutorial
    Replies: 1
    Last Post: 28-11-2007, 10:47 AM
  5. Replies: 0
    Last Post: 21-07-2007, 12:38 PM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Who's Online (0)
0
0