Skip to content
Browse files

placeholderに設定したものと同じ値をsumitする場合に値を消してしまう問題を文字色で判定することで回避

  • Loading branch information...
1 parent 1548dee commit 91c830399b2901a3cf51bf792866f011feda8fcd @k1LoW k1LoW committed
Showing with 3 additions and 4 deletions.
  1. +3 −4 jquery.ah-placeholder.js
View
7 jquery.ah-placeholder.js
@@ -78,8 +78,6 @@ $.fn.ahPlaceholder = function(options)
if ( self.value === '' ) {
self.value = phString;
- }
- if ( self.value === phString ) {
$self.css('color', settings.placeholderColor);
}
@@ -93,8 +91,9 @@ $.fn.ahPlaceholder = function(options)
}
$self.closest('form').submit(function() {
- if ( self.value === $.data(self, 'placeholder-string') ) {
- self.value = '';
+ if ( self.value === $.data(self, 'placeholder-string')
+ && $self.css('color') === settings.placeholderColor ) {
+ self.value = '';
}
return true;
});

0 comments on commit 91c8303

Please sign in to comment.
Something went wrong with that request. Please try again.