General developer forum

Help button

Picture of Matteo G
Help button

I'm working on add help button in Moodle form.

The code is "$mform->addHelpButton('String', 'HelpField');

How can I specify a string in the HelpField using php?


Average of ratings: -
Rocking some shades
Re: Help button

Hi Matteo,

If you look at the function declaration you will see which fields need to be passed through.

addHelpButton($elementname, $identifier, $component = 'moodle', $linktext = '', $suppresscheck = false)

The $elementname will be the form element the the help button should appear next to eg.'description'

$identifier is the string identifier eg. 'userdescription'

'userdescription' will then be the title of the help box and 'userdescription_help' will automatically be the text of the help box.

See the docs for more information

Average of ratings:Useful (1)