jQuery controlReplace Radio Button Demos

Setup

Easiest way is to put inputs in an extra div-element. Inputs needs at least an 'id' to be replaced.

If an label is associated with the element the 'click' Event will be redirect to the replaced one.

Basic Replace

jQuery("input.group2").controlReplace();

Full Replace

Check your console output!

jQuery("input.group3").controlReplace(

{

    additionalClass: "my-class",

    onChange: function(name, newValue)

    {

        console.log(name + ": " + newValue);

    },

    inputCss:

    {

        position: "absolute",

        top: 2,

        left: 2

    }

});

Options

additionalClass

Adds one or more additional css classes to the replacement element.

jQuery("input").controlReplace({additionalClass: "my-class"});

onChange

A callback function; will be thrown on value change.

jQuery("input").controlReplace({onChange: function(name, newValue) { console.log(name + ": " + newValue); }});

inputCss

Set css style options to the original element.

jQuery("input").controlReplace({inputCss: {position: "absolute", top: 2, left: 2}});