<code class="mix"><span class="com">// Add this code anywhere you want (after jQuery has been loaded).</span> <br /><span class="com">// Edit it to add your own expressions.</span> <br /><span class="jquery">jQuery</span>.extend(<span class="jquery">jQuery</span>.expr[<span class="string">':'</span>], { <br /> <span class="com">///////////////////////////////////////////////////////////</span> <br /> <span class="com">// form elements that are submitable based on these criteria</span> <br /> <span class="com">// element is not disabled</span> <br /> <span class="com">// element has a selected or checked attribute</span> <br /> <span class="com">// element is a textarea</span> <br /> <span class="com">// element is an input of type text or hidden</span> <br /> <span class="com">//</span> <br /> <span class="com">// @usage: $(':submitable')</span> <br /> <span class="com">// @usage: $('#myForm :submitable')</span> <br /> submitable: <span class="string">"!a.disabled&&(a.selected||a.checked||(a.nodeName.toUpperCase()=='TEXTAREA')||(a.nodeName.toUpperCase()=='INPUT'&&(a.type=='text'||a.type=='hidden'||a.type=='password')))"</span>, <br /> <br /> <span class="com">///////////////////////////////////////////////////////////</span> <br /> <span class="com">// elements that have a type attribute not equal to hidden</span> <br /> <span class="com">// use if you want to select all input elements that are not hidden</span> <br /> <span class="com">// @usage: $('input:nothidden')</span> <br /> nothidden: <span class="string">"a.type&&a.type!='hidden'"</span> <br />}) <br /></code>
This entry was posted
on Tuesday, June 10, 2008 at 6:14 AM.
You can skip to the end and leave a response.
0 Comments:
Post a Comment