Here perhaps this code can bring you an idea how to use mutiply controls with indexes and how to catch the key event of your browser.![]()
Code:<html> <head> <title></title> <script language=javascript> <!-- function Continue_onclick() { for ( i=0; 0<rd.length; i++ ) { if ( rd[i].checked == true ) { alert ( 'You have selected ' + rd[i].value ); break; } } } function document_onkeydown() { var sEnter = '13'; if ( window.event.keyCode.toString() == sEnter ){ alert ( 'You have pressed the Enter key!' ); } } //--> </script> <script language=javascript for=document event=onkeydown> <!-- document_onkeydown() //--> </script> </head> <body> <table id="oTable" name="oTable"> <tr> <td> <input type="radio" id="rd" name="rd" value="Red" checked>Red<br> <input type="radio" id="rd" name="rd" value="Green">Green<br> <input type="radio" id="rd" name="rd" value="Blue">Blue<br> <input type="radio" id="rd" name="rd" value="Black">Black </td> </tr> <tr> <td> <input type="button" value="Button" id="Continue" name="Continue" LANGUAGE=javascript onclick="return Continue_onclick()"> </td> </tr> </table> </body> </html>




Reply With Quote