Skip to content

Toggle readonly flag for form fields and change form fields enabling (disabled="disabled", ng-disabled="form.readonly") #225

@flashnot

Description

@flashnot

Hello. Please, help.

I have in app.js:
$scope.schema = {
    ...
    "readonly":true
};
$scope.form = [
    "nick",
    "email",
    {
        "key": "message",
        "type": "textarea",
        "placeholder": "Problem description",
    },
    {
        "type": "submit",
        "style": "btn-info",
        "title": "OK"
    }
    ];
$scope.model = {};
and in index.html:
<form sf-schema="schema" sf-form="form" sf-model="model"
    <div class="row">
        <div class="col-md-6">
            <div sf-insert-field="['nick']"></div>
        </div>
        <div class="col-md-6">
            <div sf-insert-field="['email']"></div>
        </div>
    </div>
</form>


I need button which can toggle form fields state (enable/disable for editing). How to implement it? Thanks, for any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions