|
|
|
alert เตือนเมื่อเลือก check box หรือ radioไม่ครบ |
|
|
|
|
|
|
|
ลองประยุกต์ดูนะฮะ
<script language="JavaScript">
function check1() {
var count , str , Var_ch;
str = "Radio V1 => \n";
for ( loopV1 = 0 ; loopV1 < 3 ; loopV1++) {
str += " radio"+ loopV1 + " check = "+ document.checkform.v1[loopV1].checked + " value = " + document.checkform.v1[loopV1].value + "\n";
}
alert( str) ;
str = "Radio V2 => \n";
for ( loopV2 = 0 ; loopV2 < 3 ; loopV2++) {
str += " radio"+ loopV2 + " check = "+ document.checkform.v2[loopV2].checked + " value = " + document.checkform.v2[loopV2].value + "\n";
}
alert( str) ;
count = document.checkform.elements.length ;
str = "checkbox => \n";
for ( loop = 0 ; loop < count ; loop++) {
if ( document.checkform.elements[loop].type === 'checkbox') {
str += " checbox "+ document.checkform.elements[loop].name + " check = "+ document.checkform.elements[loop].checked + " value = " + document.checkform.elements[loop].value + "\n";
}
}//end of for() */
alert( str) ;
return false;
}// End of function()
</script>
|
|
|
|
|
Date :
7 เม.ย. 2548 18:17:10 |
By :
Jojo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผมใช้ syntax นี้ฮะ
<form name="checkform" action="add_ques.php"method="post" onsubmit='Javascript:return check1()'>
|
|
|
|
|
Date :
7 เม.ย. 2548 18:19:20 |
By :
Jojo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|