Bootstrap check boxes and radio buttons

Source: Internet
Author: User

check boxes and radio button labels are included in the <Label> tab
<div class= "checkbox" > <label><input type= "checkbox" Value= "" > Options 1</label></div> <div class= "checkbox" > <label><input type= "checkbox" Value= "" > Options 2</label></div>

<div class= "Radio" >   <label>      <input type= "Radio" name= "Optionsradios" id= "OPTIONSRADIOS1"          value= "option1" checked> option 1   </label></div><div class= "Radio" >   <label>      <input type= "Radio" name= "Optionsradios" id= "OptionsRadios2"          value= "option2" >         option 2-select it will deselect option 1   </label>

Inline check boxes and radio buttons,
    • Use the . Checkbox-inline or . Radio-inline class for a series of check boxes and radio boxes to control their display on the same line.


<div> <label class= "Checkbox-inline" > <input type= "checkbox" Id= "Inli NeCheckbox1 "value=" option1 "> Option 1 </label> <label class=" Checkbox-inline "> <input type=" checkb Ox "id=" InlineCheckbox2 "value=" Option2 "> Options 2 </label> <label class=" Checkbox-inline "> <input      type= "checkbox" id= "InlineCheckbox3" value= "Option3" > Options 3 </label> <label class= "Checkbox-inline" > <input type= "Radio" name= "Optionsradiosinline" id= "OptionsRadios3" value= "option1" checked> option 1 </l abel> <label class= "Checkbox-inline" > <input type= "Radio" name= "Optionsradiosinline" id= "OptionsRadios4 Code for "value=" option2 "> Option 2 </label></div> 

Scaffolding automatically created CREATE view:

If the member of an object is an enumeration type, the CREATE view of the scaffolding automatically generates the drop-down menu for the enumeration type. @Html. enumdropdownlistfor (model = model. NotificationType, htmlattributes:new {@class =
"Form-control"})

<div class= "Form-group" >
@Html. labelfor (model = model. NotificationType, htmlattributes:new {@class = "Control-label col-md-2"})
<div class= "Col-md-10" >
@Html. enumdropdownlistfor (model = model. NotificationType, htmlattributes:new {@class = "Form-control"})

Although the @html.editorfor method is used below, the MVC framework recognizes that it is a Boolean type, so a checkbox is used to render the view.


<div class= "Form-group" >
@Html. labelfor (model = model. Isdismissed, htmlattributes:new {@class = "Control-label col-md-2"})
<div class= "Col-md-10" >
<div class= "checkbox" >
@Html. editorfor (model = model. isdismissed)
@Html. validationmessagefor (model = model. Isdismissed, "", new {@class = "Text-danger"})
</div>
</div>
</div>


@Html. validationmessagefor (model = model. NotificationType, "", new {@class = "Text-danger"})
</div>
</div>

Bootstrap check boxes and radio buttons

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.