# rsvp/1.3.0/jquery-validate/demo/js/cmxforms.js

RSVP and Event Management, version 1.3.0. 24 lines.

- Page: https://pluginprobe.com/plugins/rsvp/1.3.0/code/jquery-validate/demo/js/cmxforms.js
- Raw: https://pluginprobe.com/plugins/rsvp/1.3.0/raw/jquery-validate/demo/js/cmxforms.js
- Modified: 2011-05-27T15:54:00+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/rsvp/1.3.0/code/jquery-validate/demo/js/cmxforms.js#L10-L20`.

```javascript
// apply inline-box only for mozilla
if( jQuery.browser.mozilla ) {
	// do when DOM is ready
	$( function() {
		// search form, hide it, search labels to modify, filter classes nocmx and error
		$( 'form.cmxform' ).hide().find( 'p>label:not(.nocmx):not(.error)' ).each( function() {
			var $this = $(this);
			var labelContent = $this.html();
			var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
			// create block element with width of label
			var labelSpan = $("<span>")
				.css("display", "block")
				.width(labelWidth)
				.html(labelContent);
			// change display to mozilla specific inline-box
			$this.css("display", "-moz-inline-box")
				// remove children
				.empty()
				// add span element
				.append(labelSpan);
		// show form again
		}).end().show();
	});
};
```
