Implemented detail form readonly fields the correct way, this fixes copy & paste issues with Firefox
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user