Giter VIP home page Giter VIP logo

jquery-placeholder's Introduction

(Another) jQuery Placeholder

jQuery placeholder polyfill plugin with a few handy features

Usage

$('[placeholder]').placeholder();

For best results, use with HTML conditional classes

$('html.lte9 [placeholder]').placeholder();

Support for password fields

Creates a text input field and hides original password field, so placeholders are displayed correctly rather than ••••••

When text input is received to the dummy password field, input is passed back to the original password field, so information is hidden.

When the form is submitted, the dummy password fields are removed.

Blanking placeholder fields on submit

Any field that still holds the placeholder value on submit, will be blanked before the submit occurs. Ensuring placeholder values are not submitted to the back end.

You can disable this functionality using

$('form').off('submit', $.fn.placeholder.blankOnSubmit);

Modified $.fn.val function

This plugin modifies the default jQuery val() function, so attempting to retrieve the value of an input field in any other plugin/code will not retrieve the placeholder text. If the value is equal to the placeholder text, empty string is returned.

Emulated Firefox/Chrome focus functionality

Placeholder is displayed, until text input is recieved. Rather than blanking the input on focus.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.