How can I set the ID to a Form

How can I set the ID to a Form

by julio buenadicha -
Number of replies: 2

As I can see every form has the ID attribute set to "mform1". Now I need to set it to another ID, ie: "h5p-content-node-form"


Does anybody know how to do it?


Best regards.

Average of ratings: -
In reply to julio buenadicha

Re: How can I set the ID to a Form

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Take a look at param 5 of the moodleform constructor ( https://github.com/moodle/moodle/blob/master/lib/formslib.php#L159 ) - this is an array of attributes to include in the form tag. I've not tested it, but I suspect that passing array('id' => 'h5p-content-node-form') in would do what you are wanting.


Average of ratings: Useful (2)
In reply to Davo Smith

Re: How can I set the ID to a Form

by julio buenadicha -

Thank you, 


but I have already tried that, and moodle ignored this param.