Thanks for the offer but no Paypal for help. I'm only giving back what many others have given me.
We all contribute and we all gain!
That said, to put default values in a input field is pretty simple; just add a value parameter!
So this:
<input name="txtName" id="txtName" class="inputTextarea" size="50">
Becomes this:
<input name="txtName" id="txtName" class="inputTextarea" value="Fill in your name" size="50">
This is about the simplest way to accomplish this.
Some new browsers support the placeholder option and if that works then you can change the value parameter to placeholder and that will work
like a watermark. For instance, the placeholder attribute works on my iPad but not on my PC with IE9.
If you want to get very slick you can use a jquery watermark plugin.
http://code.google.com/p/jquery-watermark/
Then you can add code like this to get a watermark.
<script type="text/javascript"> function hasPlaceholderSupport() { //This function checks to see if the browser supports HTML placeholder, if not it uses jquery below var input = document.createElement('input'); return ('placeholder' in input); } $(document).ready(function () { $("select").change(function () { if (!hasPlaceholderSupport()) { $('#txtName).watermark('Fill in your name here'); } }) .change(); }); </script>
But this may be getting a bit more complicated. I would check to see if your input device supports placeholder. But if you can't depend on that being
the case then the watermark jquery plugin might just do the trick!
Bob