Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- //<![CDATA[
- window.addEvent('domready', function() {
- var value;
- // Set the input value if not already set.
- if (!$('mod_finder_q45').getProperty('value')) {
- $('mod_finder_q45').setProperty('value', 'search...');
- }
- // Get the current value.
- value = $('mod_finder_q45').getProperty('value');
- // If the current value equals the previous value, clear it.
- $('mod_finder_q45').addEvent('focus', function() {
- if (this.getProperty('value') == value) {
- this.setProperty('value', '');
- }
- });
- // If the current value is empty, set the previous value.
- $('mod_finder_q45').addEvent('blur', function() {
- if (!this.getProperty('value')) {
- this.setProperty('value', value);
- }
- });
- $('mod-finder-45').addEvent('submit', function(e){
- e = new Event(e);
- e.stop();
- // Disable select boxes with no value selected.
- if ($chk($('mod-finder-45-advanced'))) {
- $('mod-finder-45-advanced').getElements('select').each(function(s){
- if (!s.getProperty('value')) {
- s.setProperty('disabled', 'disabled');
- }
- });
- }
- $('mod-finder-45').submit();
- });
- /*
- * This segment of code sets up the autocompleter.
- */
- });
- //]]>
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement