PHP solves the checkbox Problem

Source: Internet
Author: User

<Script language = "JavaScript" type = "text/JavaScript">
Function checkbox ()
{
VaR STR = Document. getelementsbyname ("Chk ");
VaR objarray = Str. length;
VaR chestr = "";
For (I = 0; I <objarray; I ++)
{
If (STR [I]. Checked = true)
{
Chestr + = "1 ";
} Else {
Chestr + = "0 ";
}
}
Document. getelementbyid ("txtcheck"). value = chestr;
}
</SCRIPT>

 

<Tr>
<TD colspan = "4"> <Table width = "100%" border = "0" cellspacing = "0" cellpadding = "0">
<Tr>
<TD width = "4%" Height = "25" align = "Left"> <input type = "checkbox" value = "C1" name = "Chk"/> </TD>
<TD width = "12%" align = "Left"> power steering </TD>
<TD width = "5%" align = "Left"> <input type = "checkbox" value = "C2" name = "Chk"/> </TD>
& Lt; TD width = "7%" align = "Left" & gt; ABS & lt;/TD & gt;
<TD width = "5%" align = "Left"> <input type = "checkbox" value = "C3" name = "Chk"/> </TD>
<TD width = "11%" align = "Left"> GPS system </TD>
<TD width = "5%" align = "Left"> <input type = "checkbox" value = "C4" name = "Chk"/> </TD>
<TD width = "14%" align = "Left"> electric rearview mirror </TD>
<TD width = "4%" align = "Left"> <input type = "checkbox" value = "C5" name = "Chk"/> </TD>
<TD width = "16%" align = "Left"> central control/remote control lock </TD>
<TD width = "4%" align = "Left"> <input type = "checkbox" value = "C6" name = "Chk"/> </TD>
<TD width = "13%" align = "Left"> manual rearview mirror </TD>
</Tr>
<Tr>
<TD Height = "25" align = "Left"> <input type = "checkbox" value = "C7" name = "Chk"/> </TD>
<TD align = "Left"> Cd </TD>
<TD align = "Left"> <input type = "checkbox" value = "C8" name = "Chk"/> </TD>
<TD align = "Left"> VCD </TD>
<TD align = "Left"> <input type = "checkbox" value = "C9" name = "Chk"/> </TD>
<TD align = "Left"> DVD </TD>
<TD align = "Left"> <input type = "checkbox" value = "C10" name = "Chk"/> </TD>
<TD align = "Left"> On-board phone number </TD>
<TD align = "Left"> <input type = "checkbox" value = "C11" name = "Chk"/> </TD>
<TD align = "Left"> over-line-of-sight Display System </TD>
<TD align = "Left"> <input type = "checkbox" value = "C12" name = "Chk"/> </TD>
<TD align = "Left"> EFI </TD>
</Tr>
<Tr>
<TD Height = "25" align = "Left"> <input type = "checkbox" value = "C13" name = "Chk"/> </TD>
<TD align = "Left"> electric window </TD>
<TD align = "Left"> <input type = "checkbox" value = "C14" name = "Chk"/> </TD>
<TD align = "Left"> leather chair </TD>
<TD align = "Left"> <input type = "checkbox" value = "C15" name = "Chk"/> </TD>
<TD align = "Left"> chair layout </TD>
<TD align = "Left"> <input type = "checkbox" value = "C16" name = "Chk"/> </TD>
<TD align = "Left"> knitted seat </TD>
<TD align = "Left"> <input type = "checkbox" value = "C17" name = "Chk"/> </TD>
<TD align = "Left"> electric chair </TD>
<TD align = "Left"> <input type = "checkbox" value = "C6" name = "Chk"/> </TD>
<TD align = "Left"> carburetor </TD>
</Tr>
<Tr>
<TD Height = "25" align = "Left"> <input type = "checkbox" value = "C19" name = "Chk"/> </TD>
<TD align = "Left"> double airbags </TD>
<TD align = "Left"> <input type = "checkbox" value = "C20" name = "Chk"/> </TD>
<TD align = "Left"> air conditioner </TD>
<TD align = "Left"> <input type = "checkbox" value = "C21" name = "Chk"/> </TD>
<TD align = "Left"> four-wheel drive </TD>
<TD align = "Left"> <input type = "checkbox" value = "c22" name = "Chk"/> </TD>
<TD align = "Left"> cruise speed setting </TD>
<TD align = "Left"> <input type = "checkbox" value = "C23" name = "Chk"/> </TD>
<TD align = "Left"> skylight </TD>
<TD align = "Left"> <input type = "checkbox" value = "C24" name = "Chk"/> </TD>
<TD align = "Left"> single airbag </TD>
</Tr>
</Table> </TD>
</Tr>

 

 

Code and content are on the same page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.