Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Text Message Properties

$
0
0
Re: Text Message Properties
FoxPro Programming
Re: Text Message Properties
03/16/2012
03:57:24 PM
3GG0Y7C7O Show this entire thread in new window
Gratar Image based on email address
From:
To:
Attachments:
None
I went the easy route. Works like a charm.

You are my hero, Bob! Thank you for all your help on this project.



Hey Bo;

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:

<<span class="commands">input name="txtName" id="txtName" class="inputTextarea" size="50">

Becomes this:

<<span class="commands">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


Viewing all articles
Browse latest Browse all 10393

Trending Articles