If you have set the value as the “self-label” for the field, then you will get this behavior. There are other ways to set the label – I think Tim wrote an Action to do this a while back, based on some Prototype code I posted.
In an HTML5 document (or just in an HTML5-capable browser) you would use the placeholder attribute to do this trick, then the browser handles it for you. Try this trick: click once on your field, go to the third tab of the Inspector and remove the Value entirely. Then open up the Item / Extended dialog and in the input tab, click new, then enter name: placeholder, value: whatever the placeholder should be. Preview in a browser, and you should see pale gray text in the field with your placeholder text, and when you click into it, it should disappear.
Here’s a (Prototype) JavaScript hack that will provide this for any browser that doesn’t understand the standards:
var hasPlaceholder = new Element('input',{placeholder:'foo'});
if (!hasPlaceholder.placeholder == 'foo'){
$$('input[type="text"], textarea').each(function(elm){
elm['_placeholder'] = elm.readAttribute('placeholder');
if($F(elm) == '') elm.setValue(elm._placeholder);
elm.observe('focus', function(evt){
if($F(elm) == elm._placeholder) elm.clear();
});
elm.observe('blur', function(evt){
if($F(elm) == '') elm.setValue(elm._placeholder);
});
});
}
Now it won’t go so far as to style the placeholder as pale gray and so forth, but it will do for those whose browsers haven’t kept up.
Note that the placeholder attribute is not standard in HTML < 5, so you may get a validator warning for doing this trick in Freeway (since it doesn’t create an HTML5 DOCTYPE).
Walter
On Feb 14, 2012, at 6:12 AM, Justin Easthall wrote:
http://www.justineasthall.com/contactjustineas.html
Hi - when you go to fill out the form you put the curser inside the text field but the text (Email, Name etc) inside that field remains - very off putting, is their a way to make the text disappear when you put the curser in there?
Cheers!
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options