السلام عليكم
لدي form يحوي مجموعة من radio button ، كل radio سيتم التعليم عليه تبعاً لقيمة موجودة في Text-Box ، الكود و الخوارزمية :
<form > <input type="text" id="typeValue" value= "2" /> <input type="radio" id="type1" value="1"/> <input type="radio" id="type2" value="2"/> <input type="radio" id="type3" value="3"/> <input type="radio" id="type4" value="4"/> </form> <script> // when #typeValue changed , read #typeValue value then : - if typeValue.value == 1 Then check radio button #type1 - if typeValue.value == 2 Then check radio button #type2 - if typeValue.value == 3 Then check radio button #type3 - if typeValue.value == 4 Then check radio button #type4 </script>
يعني لو تم حدوث أي تغيير في قيمة الصندوق النصي ، أريد التعليم على radio button الذي يحمل نفس قيمة ذلك الصندوق النصي ، بإستخدام prototype.

