Permalink
Browse files

Merge pull request #1 from k1LoW/submit-value-equal-to-placeholder

placeholderに設定したものと同じ値をsumitする場合に値を消してしまう問題を文字色で判定することで回避
  • Loading branch information...
2 parents 1548dee + 91c8303 commit 365154571c98ba6be08338d650cc995f2374a3dc @ahomu committed Dec 1, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 jquery.ah-placeholder.js
View
@@ -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 3651545

Please sign in to comment.