/
JQueryFocus.txt
43 lines (36 loc) · 961 Bytes
/
JQueryFocus.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
%META:TOPICINFO{author="ProjectContributor" date="1296417911" format="1.1" version="1"}%
%META:TOPICPARENT{name="JQueryPlugin"}%
---+ %TOPIC%
%JQPLUGINS{"focus"
format="
Homepage: $homepage <br />
Author(s): $author <br />
Version: $version
"
}%
%STARTSECTION{"summary"}%
This plugin sets the focus on a form input field
or textarea of a form when the page is loaded.
%ENDSECTION{"summary"}%
---++ Usage
Add the css class ==jqFocus== (or ==foswikiFocus==) to the input field you'd like to focus.
---++ Example
<verbatim class="tml">
%JQREQUIRE{"focus"}%
<input type="text" class="foswikiInputField jqFocus" size="40" />
<style type="text/css">
input[type="text"]:focus {
background-color:#FFFFC0;
color:black;
}
</style>
</verbatim>
creates:
%JQREQUIRE{"focus"}%
<input type="text" class="foswikiInputField foswikiFocus" size="40" />
<style type="text/css">
input[type="text"]:focus {
background-color:#FFFFC0;
color:black;
}
</style>