General developer forum

Can a colorpicker be added to the mod_form page

 
Picture of Ravi kumar
Re: Can a colorpicker be added to the mod_form page
 


I tried your given solution but it not working, i also want to add color picker in moodle form_setting page.
our effort is as-

$PAGE->requires->js( new moodle_url($CFG->wwwroot . '/lib/javascript-static.js'));
$mform->addElement('text', 'color', get_string('colorpicker', 'congrea'),array(''id'=> 'clour'));
$mform->addElement('html', '<div class="admin_colourpicker">');
$PAGE->requires->js_init_call('M.util.init_colour_picker', array('clour', 'null'));
 
Average of ratings: -