Quantcast
Channel: Authentication
Viewing all articles
Browse latest Browse all 8256

Re: Disable/hide fields from "add a new user" form.

$
0
0
by Stan Montgomery.  

Hi all,

I realise this is an older post, but this answer may be useful.

I've worked out a way to do this while maintaining the data by making the field hidden.

By commenting out this :
    $choices = array();
    $choices['0'] = get_string('textformat');
    $choices['1'] = get_string('htmlformat');
    $mform->addElement('select', 'mailformat', get_string('emailformat'), $choices);
    $mform->setDefault('mailformat', 1);

and adding this:
        // hidden field
    $mform->addElement('hidden', 'mailformat');
    $mform->setDefault('mailformat', 1);
    $mform->setType('mailformat', PARAM_INT);

in the user/editlib.php file, it turns the dropdown into a hidden field.

I repeated this to all the fields I didn't want displayed.

Stanzahero


Viewing all articles
Browse latest Browse all 8256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>