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:09:54 PM
3GG0WI9BL Show this entire thread in new window
Gratar Image based on email address
From:
To:
Attachments:
None
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:

<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



Bob, you are my hero. Thank you very much for helping me out with this project. If you have PayPal, I'd be happy to forward you a few bucks for your time.

Additionally, I wanted to know if I could add a label to the code. For example, in the name field, I wanted to know if I can "pre-fill" the text box with text such as "Fill in your name here." The user would then erase that text and fill in their name. Hopefully that makes sense? (See www.tumblr.com for an example of this)

Here is the code that I have that *should* work but doesn't. I added the "label for=..." line. Can you tell if I'm missing something?

Response.WriteLn([ <fieldset>]) Response.WriteLn([ <legend>Name</legend>]) Response.WriteLn([ <div class="required">]) Response.WriteLn([ <label for="txtName">Please Enter Your Name</label>]) Response.WriteLn([ <input name="txtName" id="txtName" class="inputTextarea" size="50"></input>]) Response.WriteLn([ <small>Must be 50 characters or less.<br /><div id="charlimitinfo"></div></small>]) Response.WriteLn([ </div>]) Response.WriteLn([ </fieldset>]) <</div>>



Hi Bo;

Yes, I can see the problem.
I update the code line that saved the record in the table but not the code line in the page

Change this line:

oSendPage.cMessage = Alltrim(Request.Form("txtMessage"))

to This:

oSendPage.cMessage = "Name: " + ALLTRIM(Request.Form("txtName")) + " Phone: " + ALLTRIM(Request.Form("txtPhone")) + " " + Alltrim(Request.Form("txtMessage"))


Bob


Viewing all articles
Browse latest Browse all 10393

Trending Articles