Advertisement
theitd

Joomla - Add Script/Stylesheets

Nov 4th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?php
  2. // Field CSS customisation
  3. $style = 'span.optional, span.star {'
  4.     . 'display: none;'
  5.     . '}';
  6. // Postcode Lookup
  7. $javascript = 'jQuery(document).ready(function(){
  8.         jQuery(\'#postcode_lookup\').getAddress({
  9.         api_key: \'rEGHXMG9qUGt-V5u0cd-PA1941\',
  10.         check_key: true,
  11.             // Invoked if key fails check
  12.             onFailedCheck: function () {
  13.                 $("#successStatus").html("Please manually enter your address");
  14.             },
  15.         output_fields:{
  16.             line_1: \'#jform_profile_address1\',
  17.             line_2: \'#jform_profile_address2\',
  18.             line_3: \'#jform_profile_address2\',
  19.             post_town: \'#jform_profile_city\',
  20.             county: \'#jform_profile_region\',
  21.             postcode: \'#jform_profile_postcode\'
  22.         },
  23.         button_class: \'btn btn-primary\',
  24.         input_class: \'hasTooltip\'
  25.     });
  26. })';
  27. $doc =& JFactory::getDocument();
  28. $doc->addScript("/media/getaddress/jquery.getAddress-2.0.0.custom.js");
  29. $doc->addScriptDeclaration( $javascript );
  30. $doc->addStyleDeclaration( $style );
  31.  
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement