Login Latest Snippets Home My Account
Snippee! A personal code snippet manager... Store, share, organize! ...

Default values in text fields

Published: 2011-08-11 18:57:50 - In: jQuery

This snippet will enable you how to keep a default value in a text input field for when a user hasn't entered in a value to replace it

swap_val = [];
    swap_val[i] = $(this).val();
        if ($(this).val() == swap_val[i]) {
        if ($.trim($(this).val()) == "") {