แสดงบทความที่มีป้ายกำกับ javascript html dom checkbox แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ javascript html dom checkbox แสดงบทความทั้งหมด

วันเสาร์ที่ 20 สิงหาคม พ.ศ. 2554

javascript html dom checkbox

กรณีโค้ดด้านล่าง คือ checkbox ที่สร้างโดย msoffice excel เมือต้องการ เซตค่า กาในช่อง checkbox

<OBJECT class=shape id=sv_ot height=25 width=146
classid=CLSID:8BD21D40-EC42-11CE-9E0D-00AA006002F3 v:shapes =
"_x0000_s1027"><PARAM NAME="VariousPropertyBits" VALUE="1015023635"><PARAM NAME="BackColor" VALUE="14737632"><PARAM NAME="ForeColor" VALUE="2147483656"><PARAM NAME="MaxLength" VALUE="0"><PARAM NAME="BorderStyle" VALUE="0"><PARAM NAME="ScrollBars" VALUE="0"><PARAM NAME="DisplayStyle" VALUE="4"><PARAM NAME="MousePointer" VALUE="0"><PARAM NAME="Size" VALUE="3863;661"><PARAM NAME="PasswordChar" VALUE="0"><PARAM NAME="ListWidth" VALUE="0"><PARAM NAME="BoundColumn" VALUE="1"><PARAM NAME="TextColumn" VALUE="65535"><PARAM NAME="ColumnCount" VALUE="1"><PARAM NAME="ListRows" VALUE="8"><PARAM NAME="cColumnInfo" VALUE="0"><PARAM NAME="MatchEntry" VALUE="2"><PARAM NAME="ListStyle" VALUE="0"><PARAM NAME="ShowDropButtonWhen" VALUE="0"><PARAM NAME="ShowListWhen" VALUE="1"><PARAM NAME="DropButtonStyle" VALUE="1"><PARAM NAME="MultiSelect" VALUE="0"><PARAM NAME="Value" VALUE="0"><PARAM NAME="Caption" VALUE="ทำงานล่วงเวลา"><PARAM NAME="PicturePosition" VALUE="458753"><PARAM NAME="BorderColor" VALUE="2147483654"><PARAM NAME="SpecialEffect" VALUE="2"><PARAM NAME="Accelerator" VALUE="0"><PARAM NAME="GroupName" VALUE="Sheet1"><PARAM NAME="FontName" VALUE="Arial"><PARAM NAME="FontEffects" VALUE="1073741824"><PARAM NAME="FontHeight" VALUE="180"><PARAM NAME="FontOffset" VALUE="0"><PARAM NAME="FontCharSet" VALUE="0"><PARAM NAME="FontPitchAndFamily" VALUE="2"><PARAM NAME="ParagraphAlign" VALUE="1"><PARAM NAME="FontWeight" VALUE="400"></OBJECT>

ให้ใช้ javascript

if ("<%=rs2.fields("sv_ot")%>" =="1")
{
document.getElementById("sv_ot").value=true;
}
else
{
document.getElementById("sv_ot").value=false;
}