Specially I don't want user to type '_' or space in field named 'Live Session Name'.
As it's creating problem to generate recording file.
Below is the code :
$mform->addElement('text', 'name', get_string('live_session_name', 'tgwhiteboard'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');