อืมลองดูคำสั่งไล่ Element ที่ผมเขียนนะครับ แล้วก็ Comment ไว้นะครับ
ช่วยให้หาชื่อตัวแปรได้ง่ายขึ้น
========================================================
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<SCRIPT language="JavaScript" type="text/JavaScript">
function listE(E){
s = ''; i=0;
for (e in E){
s += ', '+e; i++;
if (i % 3 == 0)
s += '\n';
}
return s;
}
function ckeck()
{
//alert(listE(document.form1));
//alert(listE(document.form1['pg_detail_nametour[]']));
flag = true;
for (i=0;i<document.form1['pg_detail_nametour[]'].length;i++){
//alert(document.form1['pg_detail_nametour[]'].value);
if (document.form1['pg_detail_nametour[]'].value.length == 0)
flag = false;
}
if (flag==false)
alert('any box is still empty');
else
alert('all box is filled');
return flag;
}
</SCRIPT>
###########################################
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<SCRIPT language="JavaScript" type="text/JavaScript">
function listE(E){
s = ''; i=0;
for (e in E){
s += ', '+e; i++;
if (i % 3 == 0)
s += '\n';
}
return s;
}
function ckeck()
{
//alert(listE(document.form1));
//alert(listE(document.form1['pg_detail_nametour[]']));
flag = true;
for (i=0;i<document.form1['pg_detail_nametour[]'].length;i++){
//alert(document.form1['pg_detail_nametour[]'].value);
if (document.form1['pg_detail_nametour[]'].value == '')
flag = false;
}
if (flag==false)
alert('any box is still empty');
else
alert('all box is filled');
return flag;
}
</SCRIPT>
###########################################
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<SCRIPT language="JavaScript" type="text/JavaScript">
function listE(E){
s = ''; i=0;
for (e in E){
s += ', '+e; i++;
if (i % 3 == 0)
s += '\n';
}
return s;
}
function ckeck()
{
//alert(listE(document.form1));
//alert(listE(document.form1['pg_detail_nametour[]']));
flag = true;
for (i=0;i<document.form1['pg_detail_nametour[]'].length;i++){
if (document.form1['pg_detail_nametour[]'].value == '')
flag = false;
}
if (flag==false)
alert('some box is still empty');
else
alert('all box is filled');
return flag;
}
</SCRIPT>
อ๋อรู้แล้ว ที่แท้ [ i ] มัน กลายเป็นตัวเอียงนี่เอง ....
Date :
25 มี.ค. 2551 19:07:15
By :
dragon_html
No. 7
Guest
อันนี้น่าจะได้นะ
###########################################
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<SCRIPT language="JavaScript" type="text/JavaScript">
function listE(E){
s = ''; i=0;
for (e in E){
s += ', '+e; i++;
if (i % 3 == 0)
s += '\n';
}
return s;
}
function ckeck()
{
//alert(listE(document.form1));
//alert(listE(document.form1['pg_detail_nametour[]']));
flag = true;
for (i=0;i<document.form1['pg_detail_nametour[]'].length;i++){
if (document.form1['pg_detail_nametour[]'][ i ].value == '')
flag = false;
}
if (flag==false)
alert('some box is still empty');
else
alert('all box is filled');
return flag;
}
</SCRIPT>