I’m trying to create a dynamic form for a profile page. So what I’d like to achieve is the following:
You visit your profile and see your information
You decide you want to edit it and click the edit button
All of the text fields change into input fields that can be edited
You make your changes and click save
The appropriate table is updated and the input fields change back to static text fields
So how can I change this:
<p> Some random text here</p>
<?= $form->field($model, 'location') ?>
Without reloading the whole page and filling the input field with "Some random text here" when it changes over?
And of course, back again, updating the appropriate tables.