Playing around with jQuery – prefill search input field with description

It’s been long since I made changes to my wordpress blog site, this is what happens when you have free time as a programmer.

So, I just realized the submit button on the search form on the header is not really important, I hid it now by simply display: hidden;. Then, some text might help to indicate that that form above is used for search.

Here’s the code

1
2
3
4
5
6
7
var changed = false;
$('#searchform #s')
  .addClass('quiet').val('Search...')
  .bind('change', function(){ if ( !changed ) { changed = true; } } )
  .bind('focus', function(){ $(this).removeClass('quiet'); if ( !changed ) { $(this).val(''); }  } )
  .bind('blur', function(){ if ( !changed ) { $(this).val('Search...'); $(this).addClass('quiet'); } } 
);

In wordpress, the search input field name is ‘s’, in case you find this helpful and want to use it, just replace the #searchform #s with your own selector. I might make this a plugin someday.

Javascript Encryption

jCryption, is simply Javascript Encryption. “j” stands for jQuery as core framework. And as always, everybody likes jQuery.

Normally if you submit a form and you don’t use SSL, your data will be sent in plain text.
But SSL is neither supported by every webhost nor it’s easy to install/apply sometimes.
So I created this plug-in in order that you are able to encrypt your data fast and simple.
jCryption uses the public-key algorithm of RSA for the encryption.

Author’s site had a good documentation on usage.