Back to PhocacartRenderAdminjs class

Method renderHtmlAfterChange

public static
renderHtmlAfterChange
(mixed $changeElement, mixed $targetElement)

Method renderHtmlAfterChange - Source code

public static function renderHtmlAfterChange($changeElement, $targetElement)
{
    $s = array();
    $s[] = 'jQuery(document).ready(function() {';
    $s[] = '   jQuery("' . $changeElement . '").on("change", function(e) {';
    $s[] = '      jQuery("' . $targetElement . '").show();';
    $s[] = '   })';
    $s[] = '})';
    Factory::getDocument()->addScriptDeclaration(implode("\n", $s));
}