Activity mod_form createElement() not submitted

Activity mod_form createElement() not submitted

by F S -
Number of replies: 0

Hello,

In my activity module form that is creating an instance of the activity, I am trying to place a radio button inside a row of a table (one radio button at the end of a row of the table, for each row).

As mentioned https://moodle.org/mod/forum/discuss.php?d=372148#p1502664

we can createElement() first, then generate its HTML with the method .toHtml(). It is very useful, because I can build a string of HTML with data of my table followed by the radio button quite easily in one loop.

However, when the form is submitted, the value of the selected radio button is not sent among the instance of the activity.

Is there another way to build a well organized block of data, without mixing HTML and moodle form API (since using addElement() outside my table does send the value of the selected radio button) ?


Thanks

Average of ratings: -