Im going to make a new ajax form after save current form and redirect to edit mode. what is the best solution to do that. on_after_save() or make custom hook or something else. and how can make changes on edit mode with hooks. thanks
1. Is the form located where a normal module form is (e.g. fuel/my_module/edit/1)? 2. If so, what are you using to trigger the save for this AJAX form?
Hi, yes it is located normal module like user list. for instance, in create user, when I create new user and save it (and redirect to edit mode) I wana show a sub form under user form to add some Data for user created. user table has one to many relation with data table. I just planing to find best solution to do that. thanks.
No, I mean each user has some classes in school and I want to add user classes under user edit form (ajax form). on_after_save() doesnt render html data into user form. I added some line of code to fuel/views/_layout/admin_main.php for create extra html form on my condition: $this->load->module_view(FUEL_FOLDER, '_blocks/extra_form', $out);
Is this right way? it is work for me but I got some error like: core\Loader.php(332) : eval()'d code on line 2
This field type creates a $_POST array variable like so $_POST['user_classes'][0]['class_id']. You can then target this data in your on_after_save hook in your model.
Comments
1. Is the form located where a normal module form is (e.g. fuel/my_module/edit/1)?
2. If so, what are you using to trigger the save for this AJAX form?
for instance, in create user, when I create new user and save it (and redirect to edit mode)
I wana show a sub form under user form to add some Data for user created.
user table has one to many relation with data table.
I just planing to find best solution to do that.
thanks.
sorry for my bad english
on_after_save() doesnt render html data into user form.
I added some line of code to fuel/views/_layout/admin_main.php for create extra html form on my condition:
$this->load->module_view(FUEL_FOLDER, '_blocks/extra_form', $out);
Is this right way?
it is work for me but I got some error like:
core\Loader.php(332) : eval()'d code on line 2
http://docs.getfuelcms.com/general/forms#template
This field type creates a $_POST array variable like so $_POST['user_classes'][0]['class_id']. You can then target this data in your on_after_save hook in your model.