home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (authorize.js)

This example Drupal source code file (authorize.js) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

attach, connection-settings-update-filetransfer-default-wrapper, function, if, jquery, none, php

The authorize.js Drupal example source code

// $Id: authorize.js,v 1.3 2010/01/04 16:08:52 webchick Exp $

/**
 * @file
 * Conditionally hide or show the appropriate settings and saved defaults
 * on the file transfer connection settings form used by authorize.php.
 */

(function ($) {

Drupal.behaviors.authorizeFileTransferForm = {
  attach: function(context) {
    $('#edit-connection-settings-authorize-filetransfer-default').change(function() {
      $('.filetransfer').hide().filter('.filetransfer-' + $(this).val()).show();
    });
    $('.filetransfer').hide().filter('.filetransfer-' + $('#edit-connection-settings-authorize-filetransfer-default').val()).show();

    // Removes the float on the select box (used for non-JS interface).
    if ($('.connection-settings-update-filetransfer-default-wrapper').length > 0) {
      console.log($('.connection-settings-update-filetransfer-default-wrapper'));
      $('.connection-settings-update-filetransfer-default-wrapper').css('float', 'none');
    }
    // Hides the submit button for non-js users.
    $('#edit-submit-connection').hide();
    $('#edit-submit-process').show();
  }
};

})(jQuery);

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal authorize.js source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.