hemanthpyro - 4 months ago

I have a form account .I need to populate the form fields to corresponding value in table (similar to edit option in admin panel ). My code is {% set form=form('account').get() %} {{ form.open|raw }} {% for field in form.fields %} {% if field.label!="" %} {{field.label}} {% if field.required %} {{"*"}} {% endif %} {{ field.input|raw }} {% endfor %} {{ form.close|raw }}

Answer

hemanthpyro - 4 months ago

{% set form = form('account').entry(id).get() %} I am getting the value

ryanthompson - 4 months ago

You would simply define the entry instead of setting things manually:

{% set form = form('account').entry(entry|id).get() %}

If null the form will basically be the same as a "create" form.

hemanthpyro - 4 months ago

{% set form = form('account').entry(id).get() %} I am getting the value