Initial values in form extension

(6 posts) (2 voices)


No tags yet.

  1. Rbert, Member


    Is it possible to provide initial values when working with the form extension? For example, filling a textarea with a predefined string, which the user can then edit?

    Thank you

  2. myDBR Team, Key Master

    You can do your own custom form using a template. The forms are not limited to forms created by dbr.form command, you are free to create your own forms.

    Alternatively, use JavaScript to set the default values after the form has been loaded.
    myDBR Team

  3. myDBR Team, Key Master

    With the latest build, you can now set the initial values for the elements.

    myDBR Team

  4. Rbert, Member

    Great, thank you! I can't find how to do so in the docs though, how do I do it?

  5. myDBR Team, Key Master

    Check the documentation for default* parameters.

    For example, you can do:

    select 'dbr.form', 'textarea', 'comment', 'Comments / improvement ideas', 'required', 'This is the initial text';
    select 'dbr.form', 'date', 'license_date', 'License date', 10, 'required', current_date();
    select 'dbr.form', 'text', 'contact_info', 'Contact info', 50, null, 'This is the initial text';

    You can also set default values for radiobuttons and checkboxes.

    myDBR Team

  6. Rbert, Member

    Amazing, thank you!


You must log in to post.