Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add watermarks to the min/max fields

  • Loading branch information...
commit 8b081538a731f9aeb4c3305c364b6955b4a833cf 1 parent b606025
Mike Cooper authored
View
4 railroad/static/css/style.css
@@ -560,3 +560,7 @@ fieldset {
td.twirler {
vertical-align: top;
}
+
+.watermark {
+ color: #CCC;
+}
View
15 railroad/static/js/base.js
@@ -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");
+ }
+ });
});
View
4 railroad/templates/form.html
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.