Implemented detail form readonly fields the correct way, this fixes copy & paste issues with Firefox

This commit is contained in:
Roberto Rosario
2011-04-14 23:05:57 -04:00
parent 6a83f36770
commit 58e4e611e2
3 changed files with 3 additions and 20 deletions

View File

@@ -87,6 +87,9 @@ class DetailForm(forms.ModelForm):
)
self.fields[field_name].help_text = ''
for field_name, field in self.fields.items():
self.fields[field_name].widget.attrs.update({'readonly': 'readonly'})
class GenericConfirmForm(forms.Form):
def __init__(self, *args, **kwargs):

View File

@@ -3,16 +3,6 @@
{% block title %} :: {% with "true" as read_only %}{% with "true" as striptags %}{% include "calculate_form_title.html" %}{% endwith %}{% endwith %}{% endblock %}
{% block javascript %}
<script type="text/javascript">
$(function() {
$(".generic_subform form :input").each(function() {
this.disabled = true;
});
});
</script>
{% endblock %}
{% block sidebar %}
{% for subtemplate in sidebar_subtemplates %}
<div class="generic_subform">

View File

@@ -1,15 +1,5 @@
{% load i18n %}
{% block javascript %}
<script type="text/javascript">
$(function() {
$(".generic_subform form :input").each(function() {
this.disabled = true;
});
});
</script>
{% endblock %}
{% block stylesheets %}
<style type="text/css">
#subform form textarea,