Permalink
Browse files

Add watermarks to the min/max fields

  • Loading branch information...
1 parent b606025 commit 8b081538a731f9aeb4c3305c364b6955b4a833cf Mike Cooper committed Aug 17, 2011
Showing with 21 additions and 2 deletions.
  1. +4 −0 railroad/static/css/style.css
  2. +15 −0 railroad/static/js/base.js
  3. +2 −2 railroad/templates/form.html
@@ -560,3 +560,7 @@ fieldset {
td.twirler {
vertical-align: top;
}
+
+.watermark {
+ color: #CCC;
+}
View
@@ -43,4 +43,19 @@ $(document).ready(function() {
$(element).remove();
});
+ /*** Water marks in text boxes ***/
+ $('.watermark').bind('focus', function() {
+ var input = this;
+ $(input).data('watermark', $(input).val())
+ $(input).val("");
+ $(input).removeClass("watermark");
+ });
+
+ $('.watermark').bind('blur', function() {
+ var input = this;
+ if ($(input).val() == "") {
+ $(input).val($(input).data('watermark'))
+ .addClass("watermark");
+ }
+ });
});
@@ -38,8 +38,8 @@
<ul class="fieldset_ul">
<li>
<label for="min">Range</label>
- <input class="value half" name="min" id="min" type="text"> to
- <input class="value half" name="max" id="max" type="text">
+ <input class="value half watermark" name="min" id="min" type="text" value="Min"> to
+ <input class="value half watermark" name="max" id="max" type="text" value="Max">
</li>
<li>
<label>&nbsp;</label>

0 comments on commit 8b08153

Please sign in to comment.