ถามเรื่อง radio button ครับ
ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา ถามเรื่อง radio button ครับ
ถามเรื่อง radio button ครับ
จากหัวข้อนี้นะครับ
ถ้าต้องการทำเป็น radio ตามภาพนะครับ
เมื่อเลือก radio ข้างหน้า ตัวข้างหลังค่อยทำงาน ต้องเขียนโค้ดยังไงครับ
ขอบคุณครับ

คำแนะนำ และการใช้งาน
สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก
- ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
ความคิดเห็นที่
1
กำหนด class ให้กับ radio และก็ list menu แล้วเรียกใช้งานการจัดการด้วย jQuery
ลเองเอาตัวอย่างต่อไปนี้ไปเป็นแนวทาง
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <p> <input type= "radio" name= "radio" id= "radio" class = "css_radio_me" value= "radio2" /> Computer<br /> COMPUER ID <select name= "list_notebook_id" id= "list_notebook_id" class = "css_list_me" disabled= "disabled" > <option value= "COM1" >COM1</option> </select> </p> <p> <input type= "radio" name= "radio2" id= "radio2" class = "css_radio_me" value= "radio2" /> Notebook<br /> NOTEBOOK ID <select name= "list_notebook_id" id= "list_notebook_id" class = "css_list_me" disabled= "disabled" > <option value= "N0001" >N0001</option> </select> </p> <script type= "text/javascript" > $( function (){ $( ".css_radio_me" ).click( function (){ if ($(this).attr( "checked" )==true){ $(this).nextAll( ".css_list_me:first" ).attr( "disabled" , "" ); } else { $(this).nextAll( ".css_list_me:first" ).attr( "disabled" , "disabled" ); } }); }); </script> |
ตัวอย่าง
Computer
COMPUER ID
Notebook
NOTEBOOK ID

ขอบคุณทุกการสนับสนุน
![]()