Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@k1LoW

解決する必要があるかは疑問ですが、自分の場合必要でしたので修正してみました。

@ahomu ahomu merged commit 3651545 into ahomu:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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;
});
Something went wrong with that request. Please try again.