JQuery Mobile Tutorial: Checkboxradio plug-ins for forms

Source: Internet
Author: User
Tags bind

Article Introduction: This article gives us a deep understanding of the jquery Mobile Checkboxradio plugin.

This article gives us a deep understanding of the jquery mobile Checkboxradio plugin
The radio and checkbox in the form depend on it for initialization enhancements and the binding of some events (disable, enable, checked, unchecked), etc.

1, disable (disabled)

Example:

	Disable 	$ ("#disable_checkbox"). Bind (' click ', Function () { 		$ ("#major_eng"). Checkboxradio ("Disable"); 	
2, enable (enabled)

Example:

	Enable 	$ ("#enable_checkbox"). Bind (' click ', Function () { 		$ ("#major_eng"). Checkboxradio ("Enable"); 	
3, checked (selected)

Example:

	Select 	$ ("#checked_checkbox"). Bind (' click ', Function () { 		$ ("#major_eng"). attr ("Checked", true). Checkboxradio ("Refresh"); 	
4, unchecked (not selected)

Example:

	Do not select 	$ (' #unchecked_checkbox '). Bind (' click ', Function () { 		$ ("#major_eng"). attr ("checked", false). Checkboxradio ("Refresh"); 	
5, dynamic creation

Example:

Dynamically create $ ("#unchecked_checkbox"). Bind (' click ', Function () { 	//Once Oh 	if ($ ("#dynamic_checkbox_group"). length < 1) { 		var arr = [ 			'  ', 			' < Legend> front-end basic Technology: ', 			' js "," 			css (default selected)  ', 			'  ' 		]; 		 		 		$ (Arr.join ("")). InsertAfter ("#major_group"); 		 		You can set the subject: 		$ ("#fe_css"). Checkboxradio ({ 			theme: "E" 		}) 		//Trigger Create 		$. Mobile.pageContainer.trigger ("create"); 	} });

Demo



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.