JQuery Plugin Repository

Close Complete List of Plugins

mutuallyExcludeFields  |  Category: Forms  |  Modified: 12 Feb 2010  |  Limit a group of text fields such that only one may have data entered into it.

This plugin is applied to two or more form text input elements to limit a user to entering data into only one field in the specified group.

Summary

Script File

jq.mutuallyExcludeFields.js ( view )

Required Options

fields

An array specifying the IDs of the text fields to include n the mutually exclusive group. Default is none, denoted as an empty array, [ ], but at least two IDs must be specified upon invocation.

Basic Usage

$("ELEMENT").mutuallyExcludeFields({ options });

Minimum Browser Support

  • Apple Safari 3
  • Google Chrome 1
  • Microsoft Internet Explorer 6
  • Mozilla Firefox 3
  • Opera 9

Example

This example defines a group of three text fields as mutually exclusive.

  1. or
  2. or

Associated Code

<script type="text/javascript">
$(document).ready(function() {
  $().mutuallyExcludeFields();
    fields : ["txtField1", "txtField2", "txtField3"]
    });
  });
</script>

JQuery Plugin Repository | Home | Print

back to ksscholl.com