Archive for the ‘Uncategorized’ Category

Search Field Text Without a Submit Button

March 19th, 2010

If you are trying to implement a search field in your website but do not plan on having a submit button (relying on the user to click enter), you’re going to want to put instructions somewhere.

In my case, I decided to populate the box it self with the words “Type and press enter to search”.

1
<input type="text" name="q" value="Type and press enter to search." id="searchfield" />

Unfortunately, this left the user with the task of manually deleting the text in the box before searching. Adding a tiny bit of javascript to your HTML element will automatically remove the text when the user clicks on it and if the user doesn’t enter anything it will add the text back when the user clicks away.

1
2
3
<input type="text" name="q" value="Type and press enter to search." id="searchfield"
onfocus="if ( this.value=='Type and press enter to search.' ) { this.value = ''; }"
onblur="if ( this.value=='' ) { this.value = 'Type and press enter to search.'; }" />

Hopefully it works for you all, I have only tested it in Firefox and Safari on a Mac.

Lifestreaming via Sweetcron

April 20th, 2009

Had a Tumblr setup for a while at amdavidson.me but I already have a webserver and didn’t like dealing with another host.

So I searched around a bit and Sweetcron came up as a viable alternative for an aggregator for all my internet activities. It’s a pretty cool little app, very lightweight and seems to be pretty extensible, if I get around to it.

Anyways, check it out, it has a good summary of all the useless stuff that I do on the internet, all three of the blogs, my twitter account, my delicious bookmarks, and my flickr pictures. One stop shopping.