Prepopulate a form

schacke

Member
How do I prepopulate a form with selected elements values from the latest post from a user? The copy plugin won't do because I only need a part of the information. It's for a mecical diary.

I have searched the forums without luck. Maybe You can point me in the right direction?
 
A new form?
You can use element's "Default". Set to eval and fetch what you need from the database.

If you have a lot of elements to prepopulate it may be easier to use a form php plugin, On=new, Process = onLoad
Select whatever
$formModel->data['table___element']=...;

Or maybe the autofill form plugin (but I don't know if it's possible to get the "latest" record).
 
Last edited:
Thanks! I'm using the autofill to get data from the joined table.

'Default' seems to be the right solution for my question. I've boiled it down to only one element now. But how to I get the information from the latest post from the current user using the 'default'?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top