Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadOnly doesn't work using Bootstrap 3 #326

Closed
fellipeh opened this issue May 3, 2014 · 2 comments
Closed

ReadOnly doesn't work using Bootstrap 3 #326

fellipeh opened this issue May 3, 2014 · 2 comments

Comments

@fellipeh
Copy link

fellipeh commented May 3, 2014

Hi,

I try to make one field readonly, here is my code:

class CaixaForm(ModelForm):
    class Meta:
        model = Caixa

    def __init__(self, *args, **kwargs):
        self.helper = FormHelper()
        self.helper.form_id = 'id-caixaform'
        self.helper.form_method = 'POST'
        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-lg-4'
        self.helper.field_class = 'col-lg-10'
        self.helper.layout = Layout(
            Field('status', reandonly="true"),
            Field('dthr_cadastro', type="hidden"),
            Field('dt_movimento',  css_class="data"),
            FormActions(Submit('submit', 'Salvar Dados', css_class='btn btn-primary'))
        )

        super(CaixaForm, self).__init__(*args, **kwargs)

But doesn't work, like this screenshot:

captura de tela 2014-05-03 as 19 04 18

@petkostas
Copy link

It should be readonly='readonly' not readonly='true'

@carltongibson
Copy link
Collaborator

I'll take a PR for this but closing pending such input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants