/** * Print the first set option of a set of two choices, with a (removable) "value" HTML attribute * * @param mixed $firstChoice The first option to choose from * @param mixed $secondChoice The second option to choose from * @param bool $printValueAttribute Whether to print the "value" HTML attribute, defaults to true */ function printAttributeValueFromChoices($firstChoice, $secondChoice, $printValueAttribute = true) { $doPrint = true; if ($printValueAttribute) { $printStr = ' value="'; } else { $printStr = ''; } $fieldValue = getValueFromChoices($firstChoice, $secondChoice); if (isset($fieldValue)) { $printStr .= $fieldValue; } else { $doPrint = false; } if ($doPrint) { if ($printValueAttribute) { echo $printStr . '"'; } else { echo $printStr; } } }
var fileButton = $('#' + fileId).nextUntil('label').find('label'); if (disable) { fileButton.addClass('disabled'); } else { fileButton.removeClass('disabled'); } } document.addEventListener("DOMContentLoaded", function(event) { $('.alreadyuploaded').nextUntil('bootstrap-filestyle').find('label').each(function(index) { $(this).contents().last().replaceWith(' Choose replacement'); }); <?php $categoryValue = getValueFromChoices(@$_POST['category'], $appToEdit['category']); if ($categoryValue) { echo "\$('#category').val(" . $categoryValue . ");"; $subCategoryValue = getValueFromChoices(@$_POST['subcategory'], $appToEdit['subcategory']); if ($subCategoryValue) { echo "\$('#subcategory').val(" . $subCategoryValue . ");"; } } ?> }); </script> <?php } require_once '../../common/ucpfooter.php';