CheckBox selected in HTML, value is yes, not selected as no__html

Source: Internet
Author: User
Sencha Touch/extjs form in HTML
The checkbox in HTML is selected, value is Yes, no is selected


<input type= "text" name= "Text1" >
<input type= "text" name= "Text2" >
<input type= "text" name= "Text3" >

<input name= "CheckBox1" type= "checkbox" value= "No" class= "Duigou" >
<input name= "CheckBox2" type= "checkbox" value= "No" class= "Duigou" >
<input name= "Checkbox3" type= "checkbox" value= "No" class= "Duigou" >


1. Get all the input boxes first
var viewport=ext.viewport.down (' #视图ID ')
var inputfields=viewport.innerelement.dom.queryselectall (' input ');//Find all the input boxes in the view


2. Find the checkbox, judge if it is checked, then change the value to Yes
for (var i = 0; i < inputfields.length; i++)
{
if (inputfields[i][' type ']== ' checkbox ' && inputfields[i].checked)/is a checkbox and is selected, the value is changed to


Yes
{
Inputfields[i].value= ' yes ';
}
.....

}

http://blog.csdn.net/l863784757/article/details/15502069


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.