Created
January 23, 2009 21:58
-
-
Save howiworkdaily/51221 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Simple code snippet to apply a "* denotes required field" below the Django Admin page title, ex "Change [Model]" | |
* It also appends a "[field name]*" to all fields that are required. | |
* And finally it makes all the labels for required fields nice a red. | |
** Note: make sure to reference jquery in templates/admin/base_site.html <script type="text/javascript" src="{{ STATIC_URL }}js/jquery-latest.pack.js"></script> | |
*/ | |
$(document).ready(function() { | |
$('.required').not( $('.inline-related').find('.required') ).append('*').attr("style","color: #FF0000 !important"); | |
$('.change-form > #container > #content > h1').after('<p style="color:#FF0000 !important"><br/>* denotes required fields.</p>'); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment