Plugin jQuery: Label inside – inscription in form fields with jQuery

Label inside – inscription in form fields with jQuery
http://www.jqueryrain.com/?http://bittersmann.de/articles/label-inside/
http://bittersmann.de/articles/label-inside/
22/02/2012

Nội dung

Label inside - inscription in form fields with jQuery

This is often implemented in a way that the label in the value of the @ value attribute of input element or the content of the textarea element is set, the training and insertion is done by JavaScript. The technical implementation is problematic:

  • Caption and actual user input must be distinguished in the field and the text style (color) must be changed with JavaScript. Should also be pre-assigned fields are used, the distinction made in the markup (HTML).
  • If the JavaScript is running late, the user enters something into the field before its label was deleted. Thereby, the label text undesirable to a portion of the input.

Circumvents this difficulty, if one realizes the labeling with the appropriate HTML label element. This is encapsulated together with the input field in a container element of the class “label inside”:


Nguồn: www.jqueryrain.com/2012/02/label-inside-inscription-in-form-fields-with-jquery/


Chưa có phản hồi
Bạn vui lòng Đăng nhập để bình luận