I've been searching for hours to figure out how to implement a (seemingly) simple thing: I like the snazzy form focus effect (when you click on a form field, the outline and/or background changes). I know this is possible using Jquery, but I can't for the life of me figure out how to use it in drupal at the theme level. (I'm not developing modules or anything, I just want to add some bling to my site's forms). I (kindof) understand the basic concepts, but I'm looking for a quick tutorial or post or help for figuring out how to actually do it in drupal. Here's a link to the JQuery event in question: http://docs.jquery.com/Events/focus. Anyone implemented this or have a resource? Thanks so much!

Comments

amandawolfe’s picture

no one? :(

wilgrace’s picture

I'm looking for something similar - did you ever find a solution for this?

sovarn’s picture

create new file called script.js and put it in the theme folder.
depending on theme may be there already, if not you must add a refrence in the THEME.info file. or look here on how to add a script to a page http://drupal.org/node/304255

Then put the following code in the file.

$("input").focus(function () {
  $(this).CHAINED ANIMATIONS
});

replace the CHAINED ANIMATIONS with whateer you want it to be.
use the following as reference

http://api.jquery.com/category/css/
http://api.jquery.com/category/effects/

wilgrace’s picture

Great stuff, thank you very much - really useful little trick