html--Use the Radio box, check box, let the user select

Source: Internet
Author: User

在使用表单设计调查表时,为了减少用户的操作,使用选择框是一个好主意,html中有两种选择框,即单选框复选框,两者的区别是单选框中的选项用户只能选择一项,而复选框中用户可以任意选择多项,甚至全选。请看下面的例子:

语法:

<input   type= "Radio/checkbox"   value= "value"    name= "name"   checked= "checked"/>

1.Type:

When type= "Radio" , the control is a radio box

When type= "checkbox" , the control is a check box

2, Value: submit data to the server values (background program PHP use)

3,name: for the control name, in case the background program ASP, PHP use

4,checked: When set checked= "checked", this option is selected by default

As in the following code:

Note: The <label> tags in the code are explained in this chapter 5-9.

Results displayed in the browser:

Note : The same group of radio buttons, name values must be consistent, such as the above example is the same name "Radiolove", so that the same group of radio buttons can play the role of radio.

Practice:

html--Use the Radio box, check box, let the user select

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.