A jQuery plugin to make your form controls look how you want them to. Now with HTML-5 attributes!

Overview

(jQuery) Uniform

A jQuery plugin to make your form controls look how you want them to. Now with HTML-5 attributes!

Works well with jQuery 1.6+, but we've received patches and heard that this works with jQuery 1.3.

Version 4.3.x uses jQuery 3.3.1+ and so far, things look promising.

NPM Total Downloads Contributors License

Installation

Packaging of Uniform comes with source SASS files and minified CSS files, ready for consumption in live/production environment. You can install Uniform via one of two methods listed below:

Via NPM

NPM Monthly Downloads NPM Total Downloads

Simply run:

npm install --save @imanov/jquery.uniform

To create minified file, run (though this isn't necessary, as the minified file is already included in the package):

npm run build

Minified source file will be built inside dist/ folder.

Via Public CDN

CDNJS jsDelivr Hits

Un-minified CSS files

For your own development purposes, to get human-readable, un-minified CSS outputs, you will need to install Uniform via NPM (as shown above), install the necessary dependencies through npm install and then run gulp. Doing so will recreate readable CSS files in dist/css folder. Invoking gulp --production however, will recreate minified CSS files (which is default behavior, what we already have in the dist folder).

Implementation

There are two ways to go with this:

Basic Implementation

Basically, you can use the final assets provided in dist folder out of the box.

Stylesheets and Javascript files should be linked in the <header> of your markup (the latter, coming after jQuery):

<!-- Make sure your CSS file is listed before Javascript sources -->
<link rel="stylesheet" href="/path-to-my-assets/uniform/dist/css/default.css" media="screen">
<script src="/path-to-my-assets/jquery/dist/jquery.min.js"></script>
<script src="/path-to-my-assets/uniform/dist/js/jquery.uniform.standalone.js"></script>

Or if you are using our bundled version - jquery.uniform.bundled.js file - which already comes with jQuery (beware not to include jQuery twice):

<!-- Make sure your CSS file is listed before Javascript sources -->
<link rel="stylesheet" href="/path-to-my-assets/uniform/dist/css/default.css" media="screen">
<script src="/path-to-my-assets/uniform/dist/js/jquery.uniform.bundled.js"></script>

Advanced Implementation

To have more control over your web assets, you can directly work with our SCSS and JS files, by importing them into or bundling with your own assets. Please be advised that our Gulp configuration (via Laravel-Elixir package) includes Auto-prefixer, i.e. browser prefixes are automatically added to CSS during the post-processing of SCSS files. Whatever your post-processing solution will be (Gulp-based or Compass), you need to make sure to include Auto-prefixer in that workflow. Our SCSS source files do not include browser prefixes out of the box!

Usage

See our Wiki page for documentation.

Reporting Bugs

It sure would be handy if you could create a test page to help illustrate bugs. When you use the GitHub Issue Tracker, you could use this jsfiddle to help illustrate your point. Additionally, we have provided some demo pages in /demo folder for you to use.

Even if you don't use these assets, all sorts of feedback is welcome, but narrowing down your problem or providing an example would immediately help narrow down the problem quickly.

Contributor/Developer Assets

We have created a Docker container to help our contributors with development of Uniform.

Additionally, /dev folder contains following assets, to further enhance our capabilities:

  1. docker folder contains necessary Dockerfile to build the container.
  2. theme-kit contains assets to help you create new themes.
  3. build.sh script, which basically spins a Docker container up and builds the package, using that instance.
Comments
  • Select or radio buttons in a hidden div are not restored when div is shown

    Select or radio buttons in a hidden div are not restored when div is shown

    I'm using $(".optional").hide(); to hide some divs, but the problem is that selects or radio buttons within the div will stay hidden when the div is revealed. Am I missing something or is this not supported?

    opened by oparoz 20
  • Chrome mac select rendering bug

    Chrome mac select rendering bug

    Chrome Mac is still in beta but after using a select pull down the left hand end of the select drops down around 3px resulting in a "tear" in the image.

    critical 
    opened by zeman 16
  • Enter key pressed on form's input or textarea doesn't work

    Enter key pressed on form's input or textarea doesn't work

    I can't submit a form when I press "enter" on keyboard. I think there's something wrong with the plugin. I have to click on the button just to be able to submit the form itself. I've tried creating a new blank document with a simple form and with the plugin, still doesn't work. I'm not using any validations at all.

    Also, another comment is on the theme. Try hovering the cursor to the button, you'll see an extra outline on the left side of the button. I think this is from the images itself.

    Thanks!

    opened by earvinbryanco 15
  • Adding a demo retina theme for mobile devices with @X2 asset needs

    Adding a demo retina theme for mobile devices with @X2 asset needs

    This pull request resolves issue #233 (https://github.com/pixelmatrix/uniform/issues/233) by adding a demo theme that supports retina devices with @media query and @X2 sprite demo.

    opened by jasonsee 15
  • Uniform and JQuery UI bug

    Uniform and JQuery UI bug

    Hello,

    I'm trying to use uniform and jQuery Ui togheter, but isn't working. In the header I call jquery, jquery ui and the js file where I set up the dialog and datepicker from jquery ui. After them I call uniform, everything is on the right place. But doing this way, uniform doesn't work, and if I invert jquery ui and uniform, the dialog and datepicker stop working. Any one know why this is happening?

    Also, I call uniform in other pages, but just the first element of the form get stylized, know why?

    regards,

    RA

    test 
    opened by rapocalypse 14
  • Select auto width in Safari

    Select auto width in Safari

    Hi! I detected some problem in the visualisation of select fields in Safari, the width added by de plugin is smaller than the other browsers. Some captures of the issue:

    http://uniformjs.com/ -> Google Chrome: image Safari: image

    Any idea why happens this and how to fixed? Thanks!

    opened by eugeniojauregui 13
  • Support for Select OptGroups?

    Support for Select OptGroups?

    Select boxes with optgroups cause strange behaviour in Safari and Firefox. Selected option is either hidden or multiple options appear over the select sprite.

    Any plans to support optgroups?

    test 
    opened by th3hamburgler 13
  • Chrome v50 activates drop down twice (flickering)

    Chrome v50 activates drop down twice (flickering)

    This seems to happen after updating to Chrome 50 (though not sure if it is 100% related). You can see what is happening here:

    http://screencast.com/t/gbL9O6siz3f

    I am running v.2.2.2 of the plugin on Chrome 50 on OSX. (I don't think it is happening on Windows).

    commenting out

    var selHtml = $el.find(":selected").html();
    

    Seems to fix the issue (not sure why) or perhaps breaks something else that I am not seeing.

    browser bug 
    opened by cibgraphics 12
  • Issues when inputs have brackets

    Issues when inputs have brackets "[ ]" in the name attribute

    Currently running Uniform 2.1.1 on a .NET MVC application. Some of my inputs have name attributes that are returned from a web service and when we iterate through them we get something like this:

    <input checked="checked" id="preferenceID-1" name="PrefereceModel.CommPrefs[0].UserPreferences[0].PreferenceId" type="radio" value="Phone">
    
    <input checked="checked" id="preferenceID-1" name="PrefereceModel.CommPrefs[0].UserPreferences[0].PreferenceId" type="radio" value="Email">
    

    What I am finding is that Uniform does not like the brackets [ ] at all. In fact, it causes radios with the same name to either all be select-able, or not select-able at all! This breaks my application. Removing the brackets fixes the issue, but I cannot do this due to the dynamic nature of the form.

    Note: This issue previously only existed in IE7, but is now present in all browsers with version 2.1.1.

    bug 
    opened by kbherbert 11
  • make select box works with country locator

    make select box works with country locator

    Hello, I woud like first to thank you for this amazing and full script. been looking for such a script for a long time and had the chance to find this script today and i'm already using it... :) i do hawever have 3 small questions: 1- I can not submit a form by clicking on "Enter" keyboard, don't know why :( 2- for the input text fields, is it possible to have a hover state just like the checkboxes and radio fields?? 3- i'm trying to use a country locator (http://welovenicethings.com/examples/Geolocation/example4.html), it preselects the local country but doesnt show it in the dropdown list. do you have any idea?? Thank you so much. Reda

    opened by Redani 11
  • Any plans to add support for input type=

    Any plans to add support for input type="search" ?

    It's mainly a type="text" field, but on some browsers (it's HTML5) it gives you additional funcionality (like a stylized search box in Safari, a cache of search terms, etc). Having to use external scripts to stylize it these days...

    new feature 
    opened by dogzipp 11
  • [FR] Allow adding a CSS class to field to avoid unwanted transformation

    [FR] Allow adding a CSS class to field to avoid unwanted transformation

    I am the author of star-rating.js, a script that transforms a SELECT rating field into a star rating control.

    I use this script in a WordPress plugin that provides ratings and reviews.

    When the Uniform script is used in WordPress themes, it usually is triggered on all form fields, i.e

    $("select:not([multiple]), input:checkbox, input:radio, input:file").uniform();
    

    This makes the theme incompatible with the reviews plugin as the Uniform script adjusts the DOM which breaks the star-rating.js script. This is primarily a CSS issue as I could fix this (and likely will) by un-setting all of the CSS rules that Uniform sets on the star-rating control.

    However, a far simpler solution would be for the Uniform script to check for a particular class, which if exists, would tell Uniform not to transform the element.

    e.g.

    <!-- Do not transform elements that have the ".browser-default" CSS class -->
    <select class="browser-default"> ... </select>
    
    new feature help wanted for future reconsideration 
    opened by pryley 0
  • about bindMany

    about bindMany

    bindMany method only handle click and touchend event, why not handle change event ?

    Like checkbox, sometimes we need to change: prop('checked',true)

    UI will not change

    improvement medium priority 
    opened by Thyiad 0
  • Default behavior of inputs are not coming when CSS image is removed

    Default behavior of inputs are not coming when CSS image is removed

    When the CSS sprite images(responsible for the background for inputs) are not available or i just removed the CSS sprite image, then the default behavior of the browser for the inputs(select, input) is not coming, i just see the text alone, i am able to recreate this issue in the demo html provided in the GIT. PFA Screenshot.

    I understand this is because of the opacity which is turned off to zero by css. Is there any way to overcome this issue?

    Expected behavior: When i remove CSS background images or when CSS sprite background image is not available due to network issue, my page should take the default behavior of the browser,

    Before issue: image

    After Issue: image

    discussion improvement low priority 
    opened by shmdhussain 4
  • Flickering issues

    Flickering issues

    I use Uniform on my site and it loook great. But.... Sometimes there is a flickering om the screen. I see 'old ugly' form elements, before they are rendered into sexy forms.

    Is there a way to avoid this?

    discussion triage 
    opened by martinshoe 4
  • sizingInvisible horrible performance

    sizingInvisible horrible performance

    Hey there.

    I have a rather complex form which utilizes a wizard for usability. There are quite a lot of dropdowns and inputs which I style with uniform. The problem is that those elements are hidden on load which causes uniformjs to use sizingInvisible to get the element sizes.

    On my desktop system (2.3GHz core i7-3610QM) it takes several seconds to initialize 100 elements.

    2.5 seconds on Firefox 26 3 seconds on Chrome 32

    https://github.com/pixelmatrix/uniform/blob/master/jquery.uniform.js#L479

    You should try to find a new way of sizing the elements.

    critical discussion improvement 
    opened by Danielku15 9
A simple to do list webpage where you can log the daily tasks you have to do, mark them as checked, modify them, reorder them and remove them. Made using HTML, CSS and JavaScript.

To-Do-List This Webpage is for an app called To-Do-List which helps you add, remove or check tasks you have to do. It is a simple web page which conta

Zeeshan Haider 9 Mar 12, 2022
Serialize an HTML Form to a JavaScript Object, supporting nested attributes and arrays.

jquery.serializeJSON Adds the method .serializeJSON() to jQuery to serializes a form into a JavaScript Object. Supports the same format for nested par

Mario Izquierdo 1.7k Dec 12, 2022
Grayce Muthui 8 Jun 16, 2022
Form To CSS - jQuery-Plugin form to CSS generator

Create your own CSS generator with the form to css generator Builder plugin. Can be usefull to create your own css builder or a Wordpress plugin or any kind of apps you need a real time css generator. For example, you can create a button generator

Gino 4 Sep 26, 2021
Cross platform UI controls for progressive web and hybrid apps (plain JS, jQuery, Angular and React)

Mobiscroll What is Mobiscroll? Mobiscroll is a UI library for progressive webapps and hybrid development. Created with a lot of attention to usability

Mobiscroll 1.5k Dec 31, 2022
Group together Tailwind CSS modifiers like focus, peer-checked, dark:hover and more with HTML attributes πŸ‘©β€πŸš€

Tailwind CSS Group Classes Group together Tailwind CSS modifiers like focus, peer-checked, dark:hover and more with HTML attributes ??‍?? Using with a

Mark Mead 5 Sep 15, 2022
The website which can help you to organize your daily or weekly activities and review them when you need them. you can add, remove and delete an activity

To Do list To do project is webpack project that list activities someone can do at a specific time In this TO-DO list, you can add or remove you activ

Joffrey NKESHIMANA 5 Jul 21, 2022
WordPress Gutenberg plugin to display the attributes for the currently selected block in the Document sidebar.

Block X-ray Attributes Stable Tag: 1.2.0 Requires at least: 5.5 Tested up to: 5.9 Requires PHP: 7.2 License: GPL v2 or later Tags: block attributes, g

Sal Ferrarello 38 Mar 18, 2022
Prop-Proxy allows you to intercept getters and setters of class attributes through decorators

Prop-Proxy Proxy for class properties Prop-Proxy allows you to intercept getters and setters of class attributes through decorators Installation This

Leonardo Kaynan 6 Dec 15, 2022
This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreadsheet.

HtmlFormApp Overview This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreads

Kanshi TANAIKE 18 Oct 23, 2022
This is a Webpack based to-do-list project. With this app, users can add thier daily routine tasks to the list, mark them as complet, edit them or delete them.

To Do List This is a Webpack based to-do-list project. With this app, users can add thier daily routine tasks to the list, mark them as complet, edit

Ali Aqa Atayee 12 Oct 30, 2022
A JavaScript library stores the form-data to the localstorage so you don't have to fill the form again.

form-storage A JavaScript library stores the form-data to the localstorage so you don't have to fill the form again. Installation via npm npm install

appleple 159 Dec 10, 2022
A library for boolean aliases to help you make your code more confusing and make your coworkers hate you.

yup-nope A library for boolean aliases to help you make your code more confusing and make your coworkers hate you. Installation Using npm: npm install

Bence A. TΓ³th 4 Dec 10, 2022
The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more. Now with Bootstrap 5 support.

bootstrap-select The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more. Now with

SnapAppointments 9.7k Dec 30, 2022
The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more. Now with Bootstrap 5 support

bootstrap-select The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more. Now with

SnapAppointments 9.7k Dec 30, 2022
Immersive (VR) controls for Three.js

Three.js Immersive Controls Immersive (VR) functionality Movement and rotation with VR controllers (move with left thumbstick, rotate with right thumb

Anthony DePasquale 20 Nov 12, 2022
Access the Nintendo Switch Online and Nintendo Switch Parental Controls app APIs.

Access the Nintendo Switch Online and Nintendo Switch Parental Controls app APIs. Includes Discord Rich Presence, friend notifications and data downloads.

Samuel Elliott 201 Jan 6, 2023
Flappy Bird is an arcade-style game in which the player controls the bird Faby, which moves persistently to the right

Flappy Bird is an arcade-style game in which the player controls the bird Faby, which moves persistently to the right. The player is tasked with navigating Faby through pairs of pipes that have equally sized gaps placed at random heights. Faby automatically descends and only ascends when the player taps the touchscreen.

Ali Yaghoubi 5 Aug 16, 2022
Exposes theming options available in Joy UI by providing color palette and typography controls.

Joy Theme Creator Note: Joy UI is currently in alpha - some things may not be finished or working as expected. This project exposes the theming option

Oliver Benns 10 Dec 28, 2022