Javascript

Enable browser auto-completion on all sites

November 6th, 2006  |  Published in Code, Javascript, Technology

Do you visit websites that will not allow you to save your username and password? Does it drive you crazy? Use this free bookmarklet to override the disabling of browser auto-completion.

Instructions: (1) Save bookmarklet below to your bookmarks (right click it), or drag the link to your bookmarks toolbar (2) Go to annoying website (3) Run bookmarklet from bookmarks (4) Enter userid/pass and tell the browser to save your information.

Bookmarklet: Enable Autocomplete

Technical Explanation: It removes the “autocomplete=off” from forms so that Firefox (and probably IE) will save the information for next time you visit. I’ve tested this with Firefox 2.0 on del.icio.us and it worked great.

(source)

Clearing fields with javascript

November 3rd, 2006  |  Published in Code, Javascript, Technology

Here is an easy-to-use javascript that I wrote. It clears a field (input) if a specified word is there. I use this to clear “Search” from the search field at Desiring God. Hopefully it will be of use to others as well:

[source:javascript]
/************************************************************
** Clears a field
** HTML:
** id="search" size="25"
** onFocus="clearField('search', 'Search')" />
***********************************************************/
function clearField(field_id, term_to_clear) {
if (document.getElementById(field_id).value == term_to_clear ) {
document.getElementById(field_id).value = ”;
}
} // end clearField()
[/source]